CIFS: Make CAP_* checks protocol independent
Since both CIFS and SMB2 use ses->capabilities (server->capabilities) field but flags are different we should make such checks protocol independent. Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
This commit is contained in:

committed by
Steve French

parent
d60622eb5a
commit
29e20f9c65
@@ -3634,7 +3634,7 @@ try_mount_again:
|
||||
}
|
||||
|
||||
/* tell server which Unix caps we support */
|
||||
if (tcon->ses->capabilities & CAP_UNIX) {
|
||||
if (cap_unix(tcon->ses)) {
|
||||
/* reset of caps checks mount to see if unix extensions
|
||||
disabled for just this mount */
|
||||
reset_cifs_unix_caps(xid, tcon, cifs_sb, volume_info);
|
||||
@@ -3993,7 +3993,7 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
|
||||
ses->flags = 0;
|
||||
ses->capabilities = server->capabilities;
|
||||
if (linuxExtEnabled == 0)
|
||||
ses->capabilities &= (~CAP_UNIX);
|
||||
ses->capabilities &= (~server->vals->cap_unix);
|
||||
|
||||
cFYI(1, "Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d",
|
||||
server->sec_mode, server->capabilities, server->timeAdj);
|
||||
@@ -4100,7 +4100,7 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (ses->capabilities & CAP_UNIX)
|
||||
if (cap_unix(ses))
|
||||
reset_cifs_unix_caps(0, tcon, NULL, vol_info);
|
||||
out:
|
||||
kfree(vol_info->username);
|
||||
|
Reference in New Issue
Block a user