Permalink
Browse files

Fix Nginx "passenger_user_switching off" permission problems: issue #458

.
  • Loading branch information...
1 parent 3fc6071 commit 775e220f08d302ae633ce3d65063528cb86efd54 @FooBarWidget FooBarWidget committed May 7, 2010
Showing with 13 additions and 2 deletions.
  1. +5 −1 NEWS
  2. +8 −1 ext/common/Utils.cpp
View
6 NEWS
@@ -7,7 +7,7 @@ Release 2.2.12
how to override our support if you need special behavior.
Please refer to the Phusion Passenger Users Guide, section
"Bundler support".
- * Worked around some user account handling bugs in Ruby.
+ * Worked around some user account handling bugs in Ruby. Issue #192.
* Fixed some Ruby 1.9 tempfile.rb compatibility problems.
* Fixed some compilation problems on some ARM Linux platforms.
* [Apache] Suppress bogus mod_xsendfile-related error messages.
@@ -17,6 +17,10 @@ Release 2.2.12
normal, are harmless and can be safely ignored, but they pollute
the log file. So in this release we've added code to suppress
these messages when mod_xsendfile is being used.
+ * [Nginx] Fixed "passenger_user_switching off" permission problems
+ If Nginx is running as root and passenger_user_switching is turned
+ off, then Phusion Passenger would fail to initialize because of
+ a permission problem. This has been fixed. Issue #458.
Release 2.2.11
View
9 ext/common/Utils.cpp
@@ -359,7 +359,14 @@ createNonWritableFifo(const string &filename) {
do {
ret = mkfifo(filename.c_str(), 0);
} while (ret == -1 && errno == EINTR);
- if (ret == -1 && errno != EEXIST) {
+ if (ret == -1) {
+ if (errno == EEXIST && geteuid() != 0) {
+ // Don't try to change the permissions on the FIFO file;
+ // it was likely created by root, but after lowering privilege
+ // createPassengerTempDir() is called again, and this time
+ // we won't be able to set permissions.
+ return;
+ }
e = errno;
throw FileSystemException("Cannot create FIFO file " + filename, e, filename);
}

0 comments on commit 775e220

Please sign in to comment.