diff options
author | Andreas Schneider <asn@samba.org> | 2013-01-08 14:21:23 +0100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2013-01-09 09:11:20 +0100 |
commit | 1aa0503401d41fec48d4d4e30d8bbcbd847ff807 (patch) | |
tree | 6bd90a1f53bb28aad3f00a7e99cb6ef8abc1723f /source4 | |
parent | 6039388fc1f3671bb60db06211814f7edfc62285 (diff) | |
download | samba-1aa0503401d41fec48d4d4e30d8bbcbd847ff807.tar.gz samba-1aa0503401d41fec48d4d4e30d8bbcbd847ff807.tar.bz2 samba-1aa0503401d41fec48d4d4e30d8bbcbd847ff807.zip |
Use the new directory_create_or_exist_strict() function.
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/messaging/messaging.c | 2 | ||||
-rw-r--r-- | source4/ntp_signd/ntp_signd.c | 2 | ||||
-rw-r--r-- | source4/smbd/service_named_pipe.c | 2 | ||||
-rw-r--r-- | source4/winbind/wb_server.c | 9 |
4 files changed, 10 insertions, 5 deletions
diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c index 5966c29d5a..c37c91eb27 100644 --- a/source4/lib/messaging/messaging.c +++ b/source4/lib/messaging/messaging.c @@ -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; diff --git a/source4/ntp_signd/ntp_signd.c b/source4/ntp_signd/ntp_signd.c index 0c3899fc55..d1d8483ad7 100644 --- a/source4/ntp_signd/ntp_signd.c +++ b/source4/ntp_signd/ntp_signd.c @@ -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, diff --git a/source4/smbd/service_named_pipe.c b/source4/smbd/service_named_pipe.c index b000083eec..6aa984de22 100644 --- a/source4/smbd/service_named_pipe.c +++ b/source4/smbd/service_named_pipe.c @@ -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))); diff --git a/source4/winbind/wb_server.c b/source4/winbind/wb_server.c index a904470e19..f0367498a3 100644 --- a/source4/winbind/wb_server.c +++ b/source4/winbind/wb_server.c @@ -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; |