Fix bug #9034 - Typo in set_re_uid() call when USE_SETRESUID selected in configure.
authorJeremy Allison <jra@samba.org>
Wed, 11 Jul 2012 04:13:03 +0000 (21:13 -0700)
committerKarolin Seeger <kseeger@samba.org>
Thu, 26 Jul 2012 18:08:23 +0000 (20:08 +0200)
Previous code only set the real euid, not the effective one. This is not a security issue
as this is *only* used in the quota code, and only between code that brackets
it with save_re_uid()/restore_re_uid(), Also this is not used on most platforms
(we use USE_SETREUID by preference) but it's better to have this right.
(cherry picked from commit ceed322622b46be3745b32a5f6a02e634bfe1789)
(cherry picked from commit a224e4cc1dbb2578813ccffb80e88d9ec92516ce)

source3/lib/util_sec.c

index d7984ac99965fe0cb25f8879044998b2fc069c87..b90a6f972e2f48d0392fb2f90b27c8da62210e83 100644 (file)
@@ -334,7 +334,7 @@ int set_re_uid(void)
        uid_t uid = geteuid();
 
 #if USE_SETRESUID
-       setresuid(geteuid(), -1, -1);
+       setresuid(uid, uid, -1);
 #endif
 
 #if USE_SETREUID