From e136b95af82e200dfc28dd3e48e05c210862f906 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 13 Dec 2012 16:10:38 +0100 Subject: s4-lib: Use directory_create_or_exist() to create messaging dir. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas Schneider Reviewed-by: Günther Deschner --- source4/lib/messaging/messaging.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source4') diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c index 66188971f3..2df6f41e4c 100644 --- a/source4/lib/messaging/messaging.c +++ b/source4/lib/messaging/messaging.c @@ -576,6 +576,7 @@ struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx, struct imessaging_context *msg; NTSTATUS status; struct socket_address *path; + bool ok; if (ev == NULL) { return NULL; @@ -603,7 +604,11 @@ struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx, msg->base_path = lpcfg_imessaging_path(msg, lp_ctx); - mkdir(msg->base_path, 0700); + ok = directory_create_or_exist(msg->base_path, geteuid(), 0700); + if (!ok) { + talloc_free(msg); + return NULL; + } msg->path = imessaging_path(msg, server_id); msg->server_id = server_id; -- cgit