diff options
author | Graham Dumpleton <Graham.Dumpleton@gmail.com> | 2015-10-12 16:45:23 +1100 |
---|---|---|
committer | Graham Dumpleton <Graham.Dumpleton@gmail.com> | 2015-10-12 16:45:23 +1100 |
commit | e716679a86fc40e268fae2f03b92dfb592fd7097 (patch) | |
tree | a4acb487c308cf6ed506b5a8eaf7e21ccef08518 | |
parent | 5cf1d13d18d33861600b0aea4f807f4f3c9b7f8a (diff) | |
parent | 73ff103f38fcf8b6c2f5cfac427cf493b3d87b7d (diff) | |
download | mod_wsgi-e716679a86fc40e268fae2f03b92dfb592fd7097.tar.gz |
Merge branch 'release/4.4.19'4.4.19
-rw-r--r-- | docs/release-notes.rst | 1 | ||||
-rw-r--r-- | docs/release-notes/version-4.4.19.rst | 19 | ||||
-rw-r--r-- | src/server/wsgi_interp.c | 28 | ||||
-rw-r--r-- | src/server/wsgi_version.h | 4 |
4 files changed, 38 insertions, 14 deletions
diff --git a/docs/release-notes.rst b/docs/release-notes.rst index bacd702..6b898fc 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -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 diff --git a/docs/release-notes/version-4.4.19.rst b/docs/release-notes/version-4.4.19.rst new file mode 100644 index 0000000..372429b --- /dev/null +++ b/docs/release-notes/version-4.4.19.rst @@ -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. diff --git a/src/server/wsgi_interp.c b/src/server/wsgi_interp.c index 01f6bb3..a347e9e 100644 --- a/src/server/wsgi_interp.c +++ b/src/server/wsgi_interp.c @@ -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, @@ -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, @@ -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, @@ -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); diff --git a/src/server/wsgi_version.h b/src/server/wsgi_version.h index 747a115..b6e5dde 100644 --- a/src/server/wsgi_version.h +++ b/src/server/wsgi_version.h @@ -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" /* ------------------------------------------------------------------------- */ |