From 697e46373c8fa7b07234f6611c93cf25fe9733ed Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Fri, 25 Oct 1996 20:50:31 +0000 Subject: Changed become_user to take a vuid as second arg. Consistent with other changes to make smb_uid an index+offset into the validated_users table. jra@cygnus.com (This used to be commit 89675f8ae8f136fb587690b137f4413607d30c14) --- source3/smbd/uid.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index f7005b53cf..4fa0ed89da 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -204,13 +204,13 @@ static BOOL check_user_ok(int cnum,user_struct *vuser,int snum) /**************************************************************************** become the user of a connection number ****************************************************************************/ -BOOL become_user(int cnum, int uid) +BOOL become_user(int cnum, uint16 vuid) { - user_struct *vuser; + user_struct *vuser = get_valid_user_struct(vuid); int snum,gid; - int id = uid; + int uid; - if (current_user.cnum == cnum && current_user.id == id) { + if (current_user.cnum == cnum && vuser != 0 && current_user.id == vuser->uid) { DEBUG(4,("Skipping become_user - already user\n")); return(True); } @@ -226,7 +226,7 @@ BOOL become_user(int cnum, int uid) if (Connections[cnum].force_user || lp_security() == SEC_SHARE || - !(vuser = get_valid_user_struct(uid)) || + !(vuser) || (vuser->guest) || !check_user_ok(cnum,vuser,snum)) { uid = Connections[cnum].uid; gid = Connections[cnum].gid; @@ -235,7 +235,7 @@ BOOL become_user(int cnum, int uid) current_user.ngroups = Connections[cnum].ngroups; } else { if (!vuser) { - DEBUG(2,("Invalid vuid used %d\n",uid)); + DEBUG(2,("Invalid vuid used %d\n",vuid)); return(False); } uid = vuser->uid; @@ -266,7 +266,7 @@ BOOL become_user(int cnum, int uid) } current_user.cnum = cnum; - current_user.id = id; + current_user.id = uid; DEBUG(5,("become_user uid=(%d,%d) gid=(%d,%d)\n", getuid(),geteuid(),getgid(),getegid())); -- cgit