From 4b6d2eba7ad02564fe51206bfab9815a582516b9 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 8 May 2011 10:29:27 +0200 Subject: [PATCH] ncalrpc: Force ncalrpc dir to be mode 755 in all users This allows this directory to be shared between Samba3 and Samba4 in a Franky-style setup easily. Andrew Bartlett (cherry picked from commit aae9353ecf56323b63da66aa84d8a0a4f219d94d) (cherry picked from commit 6e89c230046f1b7300ba5f76dfbc81c57af69fe5) --- source3/rpc_server/rpc_server.c | 4 ++-- source4/smbd/service_named_pipe.c | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/source3/rpc_server/rpc_server.c b/source3/rpc_server/rpc_server.c index 681898d1b5b..164e0d8bb86 100644 --- a/source3/rpc_server/rpc_server.c +++ b/source3/rpc_server/rpc_server.c @@ -889,13 +889,13 @@ bool setup_dcerpc_ncalrpc_socket(struct tevent_context *ev_ctx, return false; } - if (!directory_create_or_exist(lp_ncalrpc_dir(), geteuid(), 0700)) { + 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; } - state->fd = create_pipe_sock(lp_ncalrpc_dir(), name, 0700); + state->fd = create_pipe_sock(lp_ncalrpc_dir(), name, 0755); if (state->fd == -1) { DEBUG(0, ("Failed to create pipe socket! [%s/%s]\n", lp_ncalrpc_dir(), name)); diff --git a/source4/smbd/service_named_pipe.c b/source4/smbd/service_named_pipe.c index 086a037b69d..a1e013db60e 100644 --- a/source4/smbd/service_named_pipe.c +++ b/source4/smbd/service_named_pipe.c @@ -200,6 +200,13 @@ NTSTATUS tstream_setup_named_pipe(TALLOC_CTX *mem_ctx, goto fail; } + if (!directory_create_or_exist(lpcfg_ncalrpc_dir(lp_ctx), geteuid(), 0755)) { + status = map_nt_error_from_unix(errno); + DEBUG(0,(__location__ ": Failed to create ncalrpc pipe directory '%s' - %s\n", + lpcfg_ncalrpc_dir(lp_ctx), nt_errstr(status))); + goto fail; + } + dirname = talloc_asprintf(pipe_sock, "%s/np", lpcfg_ncalrpc_dir(lp_ctx)); if (dirname == NULL) { goto fail; -- 2.11.4.GIT