diff options
author | Luke Leighton <lkcl@samba.org> | 2000-03-03 20:09:04 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 2000-03-03 20:09:04 +0000 |
commit | ee3dce881de04c706f25cd0ee6ce14cd10230b09 (patch) | |
tree | 539d394453054275d7395174ac4b028c63ef9733 | |
parent | 6aebc19a887ba43961b04f0c7b93df7210e0918c (diff) | |
download | samba-ee3dce881de04c706f25cd0ee6ce14cd10230b09.tar.gz samba-ee3dce881de04c706f25cd0ee6ce14cd10230b09.tar.xz samba-ee3dce881de04c706f25cd0ee6ce14cd10230b09.zip |
unbecome_root()( fix - only actually do an unbecome_root
when root depth reaches zero again.
-rw-r--r-- | source/lib/set_uid.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/lib/set_uid.c b/source/lib/set_uid.c index 48eb5ecdd66..d2661fffc7f 100644 --- a/source/lib/set_uid.c +++ b/source/lib/set_uid.c @@ -355,8 +355,17 @@ void unbecome_root(BOOL restore_dir) { DEBUG(0,("ERROR: unbecome root depth is %d\n", become_root_depth)); + SMB_ASSERT(False); } + become_root_depth--; + + if (become_root_depth > 0) + { + DEBUG(10,("not yet non-root: unbecome root depth is %d\n", + become_root_depth)); + return; + } /* we might have done a become_user() while running as root, if we have then become root again in order to become non root! */ @@ -389,5 +398,4 @@ void unbecome_root(BOOL restore_dir) current_user = current_user_saved; - become_root_depth--; } |