Skip to content

Commit e716679

Browse files
Merge branch 'release/4.4.19'
2 parents 5cf1d13 + 73ff103 commit e716679

File tree

4 files changed

+38
-14
lines changed

4 files changed

+38
-14
lines changed

docs/release-notes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Release Notes
55
.. toctree::
66
:maxdepth: 2
77

8+
release-notes/version-4.4.19
89
release-notes/version-4.4.18
910
release-notes/version-4.4.17
1011
release-notes/version-4.4.16

docs/release-notes/version-4.4.19.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
==============
2+
Version 4.4.19
3+
==============
4+
5+
Version 4.4.19 of mod_wsgi can be obtained from:
6+
7+
https://codeload.github.com/GrahamDumpleton/mod_wsgi/tar.gz/4.4.19
8+
9+
For details on the availability of Windows binaries see:
10+
11+
https://github.com/GrahamDumpleton/mod_wsgi/tree/master/win32
12+
13+
Bugs Fixed
14+
----------
15+
16+
1. Daemon mode processes were crashing when attempting to set ``USER``,
17+
``USERNAME``, ``LOGNAME`` or ``HOME`` when no password entry could be
18+
found for the current user ID. Now do not attempt to set these if the
19+
user ID doesn't have a password file entry.

src/server/wsgi_interp.c

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ InterpreterObject *newInterpreterObject(const char *name)
631631

632632
pwent = getpwuid(geteuid());
633633

634-
if (getenv("USER")) {
634+
if (pwent && getenv("USER")) {
635635
#if PY_MAJOR_VERSION >= 3
636636
key = PyUnicode_FromString("USER");
637637
value = PyUnicode_Decode(pwent->pw_name,
@@ -649,7 +649,7 @@ InterpreterObject *newInterpreterObject(const char *name)
649649
Py_DECREF(value);
650650
}
651651

652-
if (getenv("USERNAME")) {
652+
if (pwent && getenv("USERNAME")) {
653653
#if PY_MAJOR_VERSION >= 3
654654
key = PyUnicode_FromString("USERNAME");
655655
value = PyUnicode_Decode(pwent->pw_name,
@@ -667,7 +667,7 @@ InterpreterObject *newInterpreterObject(const char *name)
667667
Py_DECREF(value);
668668
}
669669

670-
if (getenv("LOGNAME")) {
670+
if (pwent && getenv("LOGNAME")) {
671671
#if PY_MAJOR_VERSION >= 3
672672
key = PyUnicode_FromString("LOGNAME");
673673
value = PyUnicode_Decode(pwent->pw_name,
@@ -718,20 +718,24 @@ InterpreterObject *newInterpreterObject(const char *name)
718718
struct passwd *pwent;
719719

720720
pwent = getpwuid(geteuid());
721+
722+
if (pwent) {
721723
#if PY_MAJOR_VERSION >= 3
722-
key = PyUnicode_FromString("HOME");
723-
value = PyUnicode_Decode(pwent->pw_dir, strlen(pwent->pw_dir),
724-
Py_FileSystemDefaultEncoding,
725-
"surrogateescape");
724+
key = PyUnicode_FromString("HOME");
725+
value = PyUnicode_Decode(pwent->pw_dir,
726+
strlen(pwent->pw_dir),
727+
Py_FileSystemDefaultEncoding,
728+
"surrogateescape");
726729
#else
727-
key = PyString_FromString("HOME");
728-
value = PyString_FromString(pwent->pw_dir);
730+
key = PyString_FromString("HOME");
731+
value = PyString_FromString(pwent->pw_dir);
729732
#endif
730733

731-
PyObject_SetItem(object, key, value);
734+
PyObject_SetItem(object, key, value);
732735

733-
Py_DECREF(key);
734-
Py_DECREF(value);
736+
Py_DECREF(key);
737+
Py_DECREF(value);
738+
}
735739
}
736740

737741
Py_DECREF(module);

src/server/wsgi_version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
#define MOD_WSGI_MAJORVERSION_NUMBER 4
2727
#define MOD_WSGI_MINORVERSION_NUMBER 4
28-
#define MOD_WSGI_MICROVERSION_NUMBER 18
29-
#define MOD_WSGI_VERSION_STRING "4.4.18"
28+
#define MOD_WSGI_MICROVERSION_NUMBER 19
29+
#define MOD_WSGI_VERSION_STRING "4.4.19"
3030

3131
/* ------------------------------------------------------------------------- */
3232

0 commit comments

Comments
 (0)