git.samba.org
/
nivanova
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6c52a37
)
s4-privs: add root_privileges_original_uid()
author
Andrew Tridgell
<tridge@samba.org>
Fri, 5 Mar 2010 06:49:11 +0000
(17:49 +1100)
committer
Andrew Tridgell
<tridge@samba.org>
Fri, 5 Mar 2010 12:07:31 +0000
(23:07 +1100)
This can be used to get the uid we changed away from when we gained
root privileges
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
lib/util/unix_privs.c
patch
|
blob
|
history
diff --git
a/lib/util/unix_privs.c
b/lib/util/unix_privs.c
index b30b2f5163c04d7d091619a1b6812f742d8adfa7..9aa9a459189bcd338a60a00ac94866f59ab70dfa 100644
(file)
--- a/
lib/util/unix_privs.c
+++ b/
lib/util/unix_privs.c
@@
-85,3
+85,9
@@
void *root_privileges(void)
talloc_set_destructor(s, privileges_destructor);
return s;
}
+
+uid_t root_privileges_original_uid(void *s)
+{
+ struct saved_state *saved = talloc_get_type_abort(s, struct saved_state);
+ return saved->uid;
+}