summaryrefslogtreecommitdiff
path: root/source4/lib/messaging
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-12-13 16:10:38 +0100
committerGünther Deschner <gd@samba.org>2012-12-21 13:55:59 +0100
commite136b95af82e200dfc28dd3e48e05c210862f906 (patch)
treef6554992f550e5f10a797cb8d347660c3b20151c /source4/lib/messaging
parent3dda9177708df4d3f2451d23a186b03a856aba87 (diff)
downloadsamba-e136b95af82e200dfc28dd3e48e05c210862f906.tar.gz
samba-e136b95af82e200dfc28dd3e48e05c210862f906.tar.bz2
samba-e136b95af82e200dfc28dd3e48e05c210862f906.zip
s4-lib: Use directory_create_or_exist() to create messaging dir.
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source4/lib/messaging')
-rw-r--r--source4/lib/messaging/messaging.c7
1 files changed, 6 insertions, 1 deletions
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;