Skip to content

Commit

Permalink
Use #nnn as default user name if no password entry for user ID which …
Browse files Browse the repository at this point in the history
…mod_wsgi-express is run as.
  • Loading branch information
GrahamDumpleton committed Oct 11, 2015
1 parent 8521cf3 commit 7e46a0b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions docs/release-notes/version-4.4.17.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ Version 4.4.17 of mod_wsgi can be obtained from:
For details on the availability of Windows binaries see:

https://github.com/GrahamDumpleton/mod_wsgi/tree/master/win32

Bugs Fixed
----------

1. If ``mod_wsgi-express`` was run under a user ID for which there was no
password entry in the system password file, it would fail when looking up
the user name. If this occurs now use ``#nnn`` as the default user name.
5 changes: 4 additions & 1 deletion src/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ def where():
return MOD_WSGI_SO

def default_run_user():
return pwd.getpwuid(os.getuid()).pw_name
try:
return pwd.getpwuid(os.getuid()).pw_name
except KeyError:
return '#%d' % os.getuid()

def default_run_group():
try:
Expand Down

0 comments on commit 7e46a0b

Please sign in to comment.