The branch, v3-6-test has been updated via ba6f63ca s3:rpc_server: create lp_ncalrpc_dir() with 0755 before lp_ncalrpc_dir()/np with 0700 via 6e89c23 ncalrpc: Force ncalrpc dir to be mode 755 in all users from 7304370 talloc: splitout _talloc_free_children_internal()
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test - Log ----------------------------------------------------------------- commit ba6f63ca67fc9e0b2bfa54ccf2cf0b78c53db74b Author: Stefan Metzmacher <me...@samba.org> Date: Tue May 17 10:32:38 2011 +0200 s3:rpc_server: create lp_ncalrpc_dir() with 0755 before lp_ncalrpc_dir()/np with 0700 metze Autobuild-User: Stefan Metzmacher <me...@samba.org> Autobuild-Date: Tue May 17 13:01:14 CEST 2011 on sn-devel-104 (cherry picked from commit cb227d6d1492247d8aff03807cac0b7266202a38) The last 2 patches address bug #8141 (wrong permissions on lp_ncalrpc_dir()). commit 6e89c230046f1b7300ba5f76dfbc81c57af69fe5 Author: Andrew Bartlett <abart...@samba.org> Date: Sun May 8 10:29:27 2011 +0200 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) ----------------------------------------------------------------------- Summary of changes: source3/rpc_server/rpc_server.c | 15 +++++++++++++-- source4/smbd/service_named_pipe.c | 7 +++++++ 2 files changed, 20 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/rpc_server/rpc_server.c b/source3/rpc_server/rpc_server.c index 681898d..8ec55bb 100644 --- a/source3/rpc_server/rpc_server.c +++ b/source3/rpc_server/rpc_server.c @@ -263,6 +263,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")); @@ -889,13 +900,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 086a037..a1e013d 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; -- Samba Shared Repository