From 99e288c22b8b1136ec639145f156527a44811e64 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 17 Jul 2014 11:34:24 +0000 Subject: [PATCH] messaging3: Move [un]become_root() calls out of messaging_dgm_send() Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/lib/messages.c | 3 +++ source3/lib/messages_dgm.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source3/lib/messages.c b/source3/lib/messages.c index a7d5fbc0a7e..06d05641e50 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -471,8 +471,11 @@ NTSTATUS messaging_send_iov(struct messaging_context *msg_ctx, return NT_STATUS_OK; } + become_root(); ret = messaging_dgm_send(msg_ctx->local, msg_ctx->id, server, msg_type, iov, iovlen); + unbecome_root(); + if (ret != 0) { return map_nt_error_from_unix(ret); } diff --git a/source3/lib/messages_dgm.c b/source3/lib/messages_dgm.c index e5da28552e3..4e75ad048c3 100644 --- a/source3/lib/messages_dgm.c +++ b/source3/lib/messages_dgm.c @@ -318,9 +318,7 @@ int messaging_dgm_send(struct messaging_dgm_context *ctx, iov2[0].iov_len = sizeof(hdr); memcpy(iov2+1, iov, iovlen*sizeof(struct iovec)); - become_root(); ret = unix_msg_send(ctx->dgm_ctx, &dst, iov2, iovlen + 1); - unbecome_root(); return ret; }