Skip to content

Commit

Permalink
Merge branch 'release/4.4.19'
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamDumpleton committed Oct 12, 2015
2 parents 5cf1d13 + 73ff103 commit e716679
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 14 deletions.
1 change: 1 addition & 0 deletions docs/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Release Notes
.. toctree::
:maxdepth: 2

release-notes/version-4.4.19
release-notes/version-4.4.18
release-notes/version-4.4.17
release-notes/version-4.4.16
Expand Down
19 changes: 19 additions & 0 deletions docs/release-notes/version-4.4.19.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
==============
Version 4.4.19
==============

Version 4.4.19 of mod_wsgi can be obtained from:

https://codeload.github.com/GrahamDumpleton/mod_wsgi/tar.gz/4.4.19

For details on the availability of Windows binaries see:

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

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

1. Daemon mode processes were crashing when attempting to set ``USER``,
``USERNAME``, ``LOGNAME`` or ``HOME`` when no password entry could be
found for the current user ID. Now do not attempt to set these if the
user ID doesn't have a password file entry.
28 changes: 16 additions & 12 deletions src/server/wsgi_interp.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ InterpreterObject *newInterpreterObject(const char *name)

pwent = getpwuid(geteuid());

if (getenv("USER")) {
if (pwent && getenv("USER")) {
#if PY_MAJOR_VERSION >= 3
key = PyUnicode_FromString("USER");
value = PyUnicode_Decode(pwent->pw_name,
Expand All @@ -649,7 +649,7 @@ InterpreterObject *newInterpreterObject(const char *name)
Py_DECREF(value);
}

if (getenv("USERNAME")) {
if (pwent && getenv("USERNAME")) {
#if PY_MAJOR_VERSION >= 3
key = PyUnicode_FromString("USERNAME");
value = PyUnicode_Decode(pwent->pw_name,
Expand All @@ -667,7 +667,7 @@ InterpreterObject *newInterpreterObject(const char *name)
Py_DECREF(value);
}

if (getenv("LOGNAME")) {
if (pwent && getenv("LOGNAME")) {
#if PY_MAJOR_VERSION >= 3
key = PyUnicode_FromString("LOGNAME");
value = PyUnicode_Decode(pwent->pw_name,
Expand Down Expand Up @@ -718,20 +718,24 @@ InterpreterObject *newInterpreterObject(const char *name)
struct passwd *pwent;

pwent = getpwuid(geteuid());

if (pwent) {
#if PY_MAJOR_VERSION >= 3
key = PyUnicode_FromString("HOME");
value = PyUnicode_Decode(pwent->pw_dir, strlen(pwent->pw_dir),
Py_FileSystemDefaultEncoding,
"surrogateescape");
key = PyUnicode_FromString("HOME");
value = PyUnicode_Decode(pwent->pw_dir,
strlen(pwent->pw_dir),
Py_FileSystemDefaultEncoding,
"surrogateescape");
#else
key = PyString_FromString("HOME");
value = PyString_FromString(pwent->pw_dir);
key = PyString_FromString("HOME");
value = PyString_FromString(pwent->pw_dir);
#endif

PyObject_SetItem(object, key, value);
PyObject_SetItem(object, key, value);

Py_DECREF(key);
Py_DECREF(value);
Py_DECREF(key);
Py_DECREF(value);
}
}

Py_DECREF(module);
Expand Down
4 changes: 2 additions & 2 deletions src/server/wsgi_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

#define MOD_WSGI_MAJORVERSION_NUMBER 4
#define MOD_WSGI_MINORVERSION_NUMBER 4
#define MOD_WSGI_MICROVERSION_NUMBER 18
#define MOD_WSGI_VERSION_STRING "4.4.18"
#define MOD_WSGI_MICROVERSION_NUMBER 19
#define MOD_WSGI_VERSION_STRING "4.4.19"

/* ------------------------------------------------------------------------- */

Expand Down

0 comments on commit e716679

Please sign in to comment.