Skip to content

Commit

Permalink
Merge pull request #228 from minrk/no-empty-shell
Browse files Browse the repository at this point in the history
don't set empty values for HOME, SHELL
  • Loading branch information
ellisonbg committed Apr 12, 2015
2 parents 43f1308 + 2890e27 commit bdbb616
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions jupyterhub/spawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,14 @@ def clear_state(self):

def user_env(self, env):
env['USER'] = self.user.name
env['HOME'] = pwd.getpwnam(self.user.name).pw_dir
env['SHELL'] = pwd.getpwnam(self.user.name).pw_shell
home = pwd.getpwnam(self.user.name).pw_dir
shell = pwd.getpwnam(self.user.name).pw_shell
# These will be empty if undefined,
# in which case don't set the env:
if home:
env['HOME'] = home
if shell:
env['SHELL'] = shell
return env

def _env_default(self):
Expand Down

0 comments on commit bdbb616

Please sign in to comment.