From daa78ead19fcbfcd5aa169d96c11ab8df49efe4b Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 13 Aug 2011 13:30:16 +1000 Subject: s3-smbd Avoid races creating 'ncaclrpc dir' with epmd in a child process --- source3/smbd/server.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source3/smbd/server.c b/source3/smbd/server.c index d396289e0d..a9762e0b52 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -1197,6 +1197,15 @@ extern void build_options(bool screen); return -1; } + /* This MUST be done before start_epmd() because otherwise + * start_epmd() forks and races against dcesrv_ep_setup() to + * call directory_create_or_exist() */ + 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))); + return -1; + } + if (is_daemon && !interactive) { enum rpc_service_mode_e epm_mode = rpc_epmapper_mode(); -- cgit