From: Jeffrey Altman Date: Sun, 3 Oct 2004 14:53:35 +0000 (+0000) Subject: windows-symlink-access-20041003 X-Git-Tag: BP-disconnected~236 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=fdaf6f793398fb7dd61bdb7030447918dbe30b38;p=packages%2Fo%2Fopenafs.git windows-symlink-access-20041003 FIXES 15250 One more fix for the symlink problem. Access control checks cannot be performed until after we have walked all of the symlinks. Otherwise, we are checking access to the symlink itself and not to the file. --- diff --git a/src/WINNT/afsd/smb3.c b/src/WINNT/afsd/smb3.c index b70ae2bff..4e56d167d 100644 --- a/src/WINNT/afsd/smb3.c +++ b/src/WINNT/afsd/smb3.c @@ -5071,16 +5071,6 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) * scp is NULL. */ if (code == 0 && !treeCreate) { - code = cm_CheckNTOpen(scp, desiredAccess, createDisp, userp, - &req); - if (code) { - if (dscp) cm_ReleaseSCache(dscp); - cm_ReleaseSCache(scp); - cm_ReleaseUser(userp); - free(realPathp); - return code; - } - if (createDisp == FILE_CREATE) { /* oops, file shouldn't be there */ if (dscp) cm_ReleaseSCache(dscp); @@ -5114,7 +5104,18 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) code = cm_SetAttr(scp, &setAttr, userp, &req); openAction = 3; /* truncated existing file */ } - else openAction = 1; /* found existing file */ + else + openAction = 1; /* found existing file */ + + code = cm_CheckNTOpen(scp, desiredAccess, createDisp, userp, + &req); + if (code) { + if (dscp) cm_ReleaseSCache(dscp); + cm_ReleaseSCache(scp); + cm_ReleaseUser(userp); + free(realPathp); + return code; + } } else if (createDisp == FILE_OPEN || createDisp == FILE_OVERWRITE) { /* don't create if not found */