diff options
author | Pavel Shilovsky <pshilovsky@samba.org> | 2012-07-13 05:58:14 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-07-24 15:12:03 -0400 |
commit | 29e20f9c65fae245d6fd4fce31cc5d01cde3d93f (patch) | |
tree | 3e8410588672f7f0947c4c9bffd2455f855d0b02 /fs/cifs/link.c | |
parent | d60622eb5a23904facf4a4efac60f5bfa810d7d4 (diff) |
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>
Diffstat (limited to 'fs/cifs/link.c')
-rw-r--r-- | fs/cifs/link.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/cifs/link.c b/fs/cifs/link.c index f78971511f5..09e4b3ae456 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c | |||
@@ -495,8 +495,8 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd) | |||
495 | * but there doesn't seem to be any harm in allowing the client to | 495 | * but there doesn't seem to be any harm in allowing the client to |
496 | * read them. | 496 | * read them. |
497 | */ | 497 | */ |
498 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) | 498 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) && |
499 | && !(tcon->ses->capabilities & CAP_UNIX)) { | 499 | !cap_unix(tcon->ses)) { |
500 | rc = -EACCES; | 500 | rc = -EACCES; |
501 | goto out; | 501 | goto out; |
502 | } | 502 | } |
@@ -518,7 +518,7 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd) | |||
518 | cifs_sb->mnt_cifs_flags & | 518 | cifs_sb->mnt_cifs_flags & |
519 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 519 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
520 | 520 | ||
521 | if ((rc != 0) && (tcon->ses->capabilities & CAP_UNIX)) | 521 | if ((rc != 0) && cap_unix(tcon->ses)) |
522 | rc = CIFSSMBUnixQuerySymLink(xid, tcon, full_path, &target_path, | 522 | rc = CIFSSMBUnixQuerySymLink(xid, tcon, full_path, &target_path, |
523 | cifs_sb->local_nls); | 523 | cifs_sb->local_nls); |
524 | 524 | ||