Use the new directory_create_or_exist_strict() function.
authorAndreas Schneider <asn@samba.org>
Tue, 8 Jan 2013 13:21:23 +0000 (14:21 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 9 Jan 2013 08:11:20 +0000 (09:11 +0100)
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/rpc_server/rpc_server.c
source3/smbd/server.c
source4/lib/messaging/messaging.c
source4/ntp_signd/ntp_signd.c
source4/smbd/service_named_pipe.c
source4/winbind/wb_server.c

index 689e923804390eb31306b36a4528a92d0f2ad3b7..de54ddc6e28e7fe7bf42e80e1efacc97f7be34b2 100644 (file)
@@ -133,7 +133,7 @@ int create_named_pipe_socket(const char *pipe_name)
                goto out;
        }
 
-       if (!directory_create_or_exist(np_dir, geteuid(), 0700)) {
+       if (!directory_create_or_exist_strict(np_dir, geteuid(), 0700)) {
                DEBUG(0, ("Failed to create pipe directory %s - %s\n",
                          np_dir, strerror(errno)));
                goto out;
index 1cd92882a96f4e10425e82cfac372513931d33ba..00472db539e6fde6f55827baca5f2fa311ca50d1 100644 (file)
@@ -1468,7 +1468,7 @@ extern void build_options(bool screen);
                return -1;
        }
 
-       if (!directory_create_or_exist(np_dir, geteuid(), 0700)) {
+       if (!directory_create_or_exist_strict(np_dir, geteuid(), 0700)) {
                DEBUG(0, ("Failed to create pipe directory %s - %s\n",
                          np_dir, strerror(errno)));
                return -1;
index 5966c29d5a7b921dad2fc76763b5f225255760e5..c37c91eb27f226642878f9b198950652e5042bd6 100644 (file)
@@ -604,7 +604,7 @@ struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx,
 
        msg->base_path     = lpcfg_imessaging_path(msg, lp_ctx);
 
-       ok = directory_create_or_exist(msg->base_path, geteuid(), 0700);
+       ok = directory_create_or_exist_strict(msg->base_path, geteuid(), 0700);
        if (!ok) {
                talloc_free(msg);
                return NULL;
index 0c3899fc55bb41e18142eb99005041f3c2b9e63a..d1d8483ad7abe9e34ad5d18402a69c753e6fbdc5 100644 (file)
@@ -498,7 +498,7 @@ static void ntp_signd_task_init(struct task_server *task)
 
        const char *address;
 
-       if (!directory_create_or_exist(lpcfg_ntp_signd_socket_directory(task->lp_ctx), geteuid(), 0750)) {
+       if (!directory_create_or_exist_strict(lpcfg_ntp_signd_socket_directory(task->lp_ctx), geteuid(), 0750)) {
                char *error = talloc_asprintf(task, "Cannot create NTP signd pipe directory: %s", 
                                              lpcfg_ntp_signd_socket_directory(task->lp_ctx));
                task_server_terminate(task,
index b000083eecd148c24134cb970822e5ec49366799..6aa984de22a26013491cffa86716de037c3653d9 100644 (file)
@@ -212,7 +212,7 @@ NTSTATUS tstream_setup_named_pipe(TALLOC_CTX *mem_ctx,
                goto fail;
        }
 
-       if (!directory_create_or_exist(dirname, geteuid(), 0700)) {
+       if (!directory_create_or_exist_strict(dirname, geteuid(), 0700)) {
                status = map_nt_error_from_unix_common(errno);
                DEBUG(0,(__location__ ": Failed to create stream pipe directory '%s' - %s\n",
                         dirname, nt_errstr(status)));
index a904470e1936cac5da5f1685cac51327a55b1c56..f0367498a389f74cd7cf34058b9f3e83f936efb4 100644 (file)
@@ -199,6 +199,7 @@ static void winbind_task_init(struct task_server *task)
        struct wbsrv_listen_socket *listen_socket;
        char *errstring;
        struct dom_sid *primary_sid;
+       bool ok;
 
        task_server_set_title(task, "task[winbind]");
 
@@ -213,14 +214,18 @@ static void winbind_task_init(struct task_server *task)
        }
 
        /* Make sure the directory for the Samba3 socket exists, and is of the correct permissions */
-       if (!directory_create_or_exist(lpcfg_winbindd_socket_directory(task->lp_ctx), geteuid(), 0755)) {
+       ok = directory_create_or_exist_strict(lpcfg_winbindd_socket_directory(task->lp_ctx),
+                                             geteuid(), 0755);
+       if (!ok) {
                task_server_terminate(task,
                                      "Cannot create winbindd pipe directory", true);
                return;
        }
 
        /* Make sure the directory for the Samba3 socket exists, and is of the correct permissions */
-       if (!directory_create_or_exist(lpcfg_winbindd_privileged_socket_directory(task->lp_ctx), geteuid(), 0750)) {
+       ok = directory_create_or_exist_strict(lpcfg_winbindd_privileged_socket_directory(task->lp_ctx),
+                       geteuid(), 0750);
+       if (!ok) {
                task_server_terminate(task,
                                      "Cannot create winbindd privileged pipe directory", true);
                return;