summaryrefslogtreecommitdiff
path: root/source3/lib/util_sec.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2003-10-23 16:49:46 +0000
committerVolker Lendecke <vlendec@samba.org>2003-10-23 16:49:46 +0000
commit4f62277d89bacff1f42e73bd86342f25116d8643 (patch)
treef7188fa49843a8bb7dfcb16b434621a04718e835 /source3/lib/util_sec.c
parentc3125b6e2f1e1916faeb02460ab9064ab65dc8a9 (diff)
downloadsamba-4f62277d89bacff1f42e73bd86342f25116d8643.tar.gz
samba-4f62277d89bacff1f42e73bd86342f25116d8643.tar.bz2
samba-4f62277d89bacff1f42e73bd86342f25116d8643.zip
After a phonecall with jra finally commit this.
This changes our behaviour when the setresuid call is available. We now not only change the effective uid but also the real uid when becoming unprivileged. This is mainly for improved AFS compatibility, as AFS selects the token to send to the server based on the real uid of the process. I tested this with a W2k server with two non-root 'runas' sessions. They come in via a single smbd as two different users using two session setups. Samba on Linux can still switch between the two uids, proved by two different files created via those sessions. Volker (This used to be commit 556c62f93535c606122b22e7e843d9da9a1cd438)
Diffstat (limited to 'source3/lib/util_sec.c')
-rw-r--r--source3/lib/util_sec.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/source3/lib/util_sec.c b/source3/lib/util_sec.c
index 1980b8bfb7..7c2576ed91 100644
--- a/source3/lib/util_sec.c
+++ b/source3/lib/util_sec.c
@@ -183,11 +183,8 @@ void gain_root_group_privilege(void)
void set_effective_uid(uid_t uid)
{
#if USE_SETRESUID
- /* On Systems which have this function, would it not be more
- * appropriate to also set the real uid by doing
- * setresuid(uid,uid,-1)? This would make patching AFS
- * unnecessary. See comment in lib/afs.c. */
- setresuid(-1,uid,-1);
+ /* Set the effective as well as the real uid. */
+ setresuid(uid,uid,-1);
#endif
#if USE_SETREUID