Skip to content

Commit

Permalink
give unix sockets 777 permissions SERVER-1774
Browse files Browse the repository at this point in the history
  • Loading branch information
RedBeard0531 committed Sep 13, 2010
1 parent 86f511e commit 4fada3f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions util/message.cpp
Expand Up @@ -34,6 +34,7 @@

#ifndef _WIN32
#include <sys/resource.h>
#include <sys/stat.h>
#else

// errno doesn't work for winsock.
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 4fada3f

Please sign in to comment.