summaryrefslogtreecommitdiff
path: root/source3/smbd/server.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-08-13 13:30:16 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-08-13 20:18:41 +1000
commitdaa78ead19fcbfcd5aa169d96c11ab8df49efe4b (patch)
treeae1f3c6a03471ea6bd8b35fdecd11c4c3ff31545 /source3/smbd/server.c
parentb51f97325b8ea330e20ee7c4bf673c4475dd0a0e (diff)
downloadsamba-daa78ead19fcbfcd5aa169d96c11ab8df49efe4b.tar.gz
samba-daa78ead19fcbfcd5aa169d96c11ab8df49efe4b.tar.bz2
samba-daa78ead19fcbfcd5aa169d96c11ab8df49efe4b.zip
s3-smbd Avoid races creating 'ncaclrpc dir' with epmd in a child process
Diffstat (limited to 'source3/smbd/server.c')
-rw-r--r--source3/smbd/server.c9
1 files changed, 9 insertions, 0 deletions
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();