aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Bühler <stbuehler@web.de>2009-07-18 14:27:21 +0000
committerStefan Bühler <stbuehler@web.de>2009-07-18 14:27:21 +0000
commitc51f3a2c21dca599459f46268ce5bcc0d3609667 (patch)
tree8a88c5ab26b39b632e0dd2c01187cba4c9b9c63d
parent89d643387ef2ad3482dccadb197969144faae305 (diff)
downloadspawn-fcgi-c51f3a2c21dca599459f46268ce5bcc0d3609667.tar.gz
spawn-fcgi-c51f3a2c21dca599459f46268ce5bcc0d3609667.zip
Fix Invalid Argument in chmod if mode=-1 (fixes 2033)
git-svn-id: svn://svn.lighttpd.net/spawn-fcgi/trunk@52 4a9f3682-ca7b-49a8-9a55-ba4640e46f83
-rw-r--r--NEWS1
-rw-r--r--src/spawn-fcgi.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 416084b..cc1d68a 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ NEWS
- 1.6.3 -
* Fix unix socket mode change to work without specifying user/group for socket
* Add some ./run script examples for use with daemontools or runit
+ * Fix Invalid Argument in chmod if mode=-1 (fixes 2033)
- 1.6.2 - 2009-04-18
* Add homepage to README
diff --git a/src/spawn-fcgi.c b/src/spawn-fcgi.c
index 29c84b8..09a0da0 100644
--- a/src/spawn-fcgi.c
+++ b/src/spawn-fcgi.c
@@ -200,7 +200,7 @@ static int bind_socket(const char *addr, unsigned short port, const char *unixso
}
}
- if (-1 == chmod(unixsocket, mode)) {
+ if (-1 != mode && -1 == chmod(unixsocket, mode)) {
fprintf(stderr, "spawn-fcgi: couldn't chmod socket: %s\n", strerror(errno));
close(fcgi_fd);
unlink(unixsocket);