summaryrefslogtreecommitdiff
path: root/source3/lib/messages.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-04-05 23:56:10 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:11 -0500
commitbc45c82904e268327bfbf72cd3f35699ae6e7397 (patch)
tree1ff4f7e3d1befc81659a01f1dedf72756ff020a6 /source3/lib/messages.c
parent90dc2613153bb8c865a1cfda0318ae4db3cf212e (diff)
downloadsamba-bc45c82904e268327bfbf72cd3f35699ae6e7397.tar.gz
samba-bc45c82904e268327bfbf72cd3f35699ae6e7397.tar.bz2
samba-bc45c82904e268327bfbf72cd3f35699ae6e7397.zip
r22096: become_root_uid_only() is unneeded - it's only used in
messages.c. Refactor to use become_root() instead and make it local to messages.c Jeremy. (This used to be commit f3ffb3f98472b69b476b702dfe5c0575b32da018)
Diffstat (limited to 'source3/lib/messages.c')
-rw-r--r--source3/lib/messages.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index 336a9349e6..316854f643 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -183,13 +183,18 @@ static NTSTATUS message_notify(struct process_id procid)
SMB_ASSERT(pid > 0);
if (euid != 0) {
- become_root_uid_only();
+ /* If we're not root become so to send the message. */
+ save_re_uid();
+ set_effective_uid(0);
}
ret = kill(pid, SIGUSR1);
if (euid != 0) {
- unbecome_root_uid_only();
+ /* Go back to who we were. */
+ int saved_errno = errno;
+ restore_re_uid_fromroot();
+ errno = saved_errno;
}
if (ret == -1) {