diff options
author | Mathias Stearn <mathias@10gen.com> | 2010-09-13 19:13:32 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2010-09-13 19:13:32 -0400 |
commit | 4fada3fc467c47bb3766ea694d1796d46929b7cb (patch) | |
tree | a1b6536a48278d2c324b2c71b2add745288d0255 | |
parent | 86f511ead098c9d8512a61b70dad906a9a864779 (diff) | |
download | mongo-4fada3fc467c47bb3766ea694d1796d46929b7cb.tar.gz |
give unix sockets 777 permissions SERVER-1774
-rw-r--r-- | util/message.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/util/message.cpp b/util/message.cpp index 3914f7cf2c3..ee9ec779e57 100644 --- a/util/message.cpp +++ b/util/message.cpp @@ -34,6 +34,7 @@ #ifndef _WIN32 #include <sys/resource.h> +#include <sys/stat.h> #else // errno doesn't work for winsock. @@ -144,6 +145,14 @@ namespace mongo { return; } +#if !defined(_WIN32) + if (me.getType() == AF_UNIX){ + if (chmod(me.getAddr().c_str(), 0777) == -1){ + log() << "couldn't chmod socket file " << me << errnoWithDescription() << endl; + } + } +#endif + if ( ::listen(sock, 128) != 0 ) { log() << "listen(): listen() failed " << errnoWithDescription() << endl; closesocket(sock); |