pop environment variables in subprocess

avoid kernel processes inheriting server security values
This commit is contained in:
MinRK
2014-08-22 18:04:28 -07:00
parent 936d385c47
commit 87eb96d22a
2 changed files with 3 additions and 3 deletions

View File

@@ -99,8 +99,8 @@ class SingleUserNotebookApp(NotebookApp):
s = self.webapp_settings s = self.webapp_settings
s['token_cache'] = {} s['token_cache'] = {}
s['user'] = self.user s['user'] = self.user
s['hub_api_key'] = env.get('IPY_API_TOKEN', '') s['hub_api_key'] = env.pop('JPY_API_TOKEN', '')
s['cookie_secret'] = env.get('IPY_COOKIE_SECRET', '') s['cookie_secret'] = env.pop('JPY_COOKIE_SECRET', '')
s['cookie_name'] = self.cookie_name s['cookie_name'] = self.cookie_name
s['login_url'] = url_path_join(self.hub_prefix, 'login') s['login_url'] = url_path_join(self.hub_prefix, 'login')
s['hub_api_url'] = self.hub_api_url s['hub_api_url'] = self.hub_api_url

View File

@@ -39,7 +39,7 @@ class Spawner(LoggingConfigurable):
hub = Any() hub = Any()
api_token = Unicode() api_token = Unicode()
env_prefix = Unicode('IPY_') env_prefix = Unicode('JPY_')
def _env_key(self, d, key, value): def _env_key(self, d, key, value):
d['%s%s' % (self.env_prefix, key)] = value d['%s%s' % (self.env_prefix, key)] = value