s3:rpc_server: create lp_ncalrpc_dir() with 0755 before lp_ncalrpc_dir()/np with...
authorStefan Metzmacher <metze@samba.org>
Tue, 17 May 2011 08:32:38 +0000 (10:32 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 17 May 2011 11:01:14 +0000 (13:01 +0200)
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue May 17 13:01:14 CEST 2011 on sn-devel-104

source3/rpc_server/rpc_server.c

index cb6fbf0b007fa3311dfac99f07f1ece6c75835b8..3f81a2ff386df3d6e2895d922d405aac4528625f 100644 (file)
@@ -261,6 +261,17 @@ bool setup_named_pipe_socket(const char *pipe_name,
        }
        state->fd = -1;
 
+       /*
+        * As lp_ncalrpc_dir() should have 0755, but
+        * lp_ncalrpc_dir()/np should have 0700, we need to
+        * create lp_ncalrpc_dir() first.
+        */
+       if (!directory_create_or_exist(lp_ncalrpc_dir(), geteuid(), 0755)) {
+               DEBUG(0, ("Failed to create pipe directory %s - %s\n",
+                         lp_ncalrpc_dir(), strerror(errno)));
+               goto out;
+       }
+
        np_dir = talloc_asprintf(state, "%s/np", lp_ncalrpc_dir());
        if (!np_dir) {
                DEBUG(0, ("Out of memory\n"));