diff options
author | Andrew Tridgell <tridge@samba.org> | 1997-10-21 11:54:57 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1997-10-21 11:54:57 +0000 |
commit | 8e90e1ef276c4cc362e32985c2845fc4c5108273 (patch) | |
tree | 80ec012cfd202438d7b3f8169d731ae3d06fe1d7 /source | |
parent | 1b056ddd9a787de902639b2ed85fe3953a750562 (diff) | |
download | samba-8e90e1ef276c4cc362e32985c2845fc4c5108273.tar.gz samba-8e90e1ef276c4cc362e32985c2845fc4c5108273.tar.xz samba-8e90e1ef276c4cc362e32985c2845fc4c5108273.zip |
fix the order of become_uid() and become_gid() in become_root(). This
was a harmless bug but left log entries
code cleanup in reply_lanman2()
Diffstat (limited to 'source')
-rw-r--r-- | source/smbd/server.c | 9 | ||||
-rw-r--r-- | source/smbd/uid.c | 2 |
2 files changed, 2 insertions, 9 deletions
diff --git a/source/smbd/server.c b/source/smbd/server.c index f6a43a536da..6fe89b8e958 100644 --- a/source/smbd/server.c +++ b/source/smbd/server.c @@ -3546,11 +3546,6 @@ int reply_lanman1(char *outbuf) int secword=0; BOOL doencrypt = SMBENCRYPT(); time_t t = time(NULL); - /* We need to save and restore this as it can be destroyed - if we call another server if security=server - Thanks to Paul Nelson @ Thursby for pointing this out. - */ - uint16 mid = SVAL(outbuf, smb_mid); if (lp_security()>=SEC_USER) secword |= 1; if (doencrypt) secword |= 2; @@ -3564,7 +3559,6 @@ int reply_lanman1(char *outbuf) Protocol = PROTOCOL_LANMAN1; CVAL(outbuf,smb_flg) = 0x81; /* Reply, SMBlockread, SMBwritelock supported */ - SSVAL(outbuf,smb_mid,mid); /* Restore possibly corrupted mid */ SSVAL(outbuf,smb_vwv2,max_recv); SSVAL(outbuf,smb_vwv3,lp_maxmux()); /* maxmux */ SSVAL(outbuf,smb_vwv4,1); @@ -3616,11 +3610,10 @@ int reply_lanman2(char *outbuf) set_message(outbuf,13,crypt_len,True); SSVAL(outbuf,smb_vwv1,secword); + SIVAL(outbuf,smb_vwv6,getpid()); if (doencrypt) memcpy(smb_buf(outbuf), cryptkey, 8); - SIVAL(outbuf,smb_vwv6,getpid()); - Protocol = PROTOCOL_LANMAN2; CVAL(outbuf,smb_flg) = 0x81; /* Reply, SMBlockread, SMBwritelock supported */ diff --git a/source/smbd/uid.c b/source/smbd/uid.c index 42ade7e4da1..28bf4b421ac 100644 --- a/source/smbd/uid.c +++ b/source/smbd/uid.c @@ -505,8 +505,8 @@ void become_root(BOOL save_dir) current_user_saved = current_user; become_root_depth = 1; - become_gid(0); become_uid(0); + become_gid(0); } /**************************************************************************** |