diff options
Diffstat (limited to 'fs/cifs/smb1ops.c')
-rw-r--r-- | fs/cifs/smb1ops.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c index 384cffe42850..5f5ba0dc2ee1 100644 --- a/fs/cifs/smb1ops.c +++ b/fs/cifs/smb1ops.c | |||
@@ -534,10 +534,12 @@ cifs_is_path_accessible(const unsigned int xid, struct cifs_tcon *tcon, | |||
534 | static int | 534 | static int |
535 | cifs_query_path_info(const unsigned int xid, struct cifs_tcon *tcon, | 535 | cifs_query_path_info(const unsigned int xid, struct cifs_tcon *tcon, |
536 | struct cifs_sb_info *cifs_sb, const char *full_path, | 536 | struct cifs_sb_info *cifs_sb, const char *full_path, |
537 | FILE_ALL_INFO *data, bool *adjustTZ) | 537 | FILE_ALL_INFO *data, bool *adjustTZ, bool *symlink) |
538 | { | 538 | { |
539 | int rc; | 539 | int rc; |
540 | 540 | ||
541 | *symlink = false; | ||
542 | |||
541 | /* could do find first instead but this returns more info */ | 543 | /* could do find first instead but this returns more info */ |
542 | rc = CIFSSMBQPathInfo(xid, tcon, full_path, data, 0 /* not legacy */, | 544 | rc = CIFSSMBQPathInfo(xid, tcon, full_path, data, 0 /* not legacy */, |
543 | cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & | 545 | cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & |
@@ -554,6 +556,23 @@ cifs_query_path_info(const unsigned int xid, struct cifs_tcon *tcon, | |||
554 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 556 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
555 | *adjustTZ = true; | 557 | *adjustTZ = true; |
556 | } | 558 | } |
559 | |||
560 | if (!rc && (le32_to_cpu(data->Attributes) & ATTR_REPARSE)) { | ||
561 | int tmprc; | ||
562 | int oplock = 0; | ||
563 | __u16 netfid; | ||
564 | |||
565 | /* Need to check if this is a symbolic link or not */ | ||
566 | tmprc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN, | ||
567 | FILE_READ_ATTRIBUTES, 0, &netfid, &oplock, | ||
568 | NULL, cifs_sb->local_nls, | ||
569 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); | ||
570 | if (tmprc == -EOPNOTSUPP) | ||
571 | *symlink = true; | ||
572 | else | ||
573 | CIFSSMBClose(xid, tcon, netfid); | ||
574 | } | ||
575 | |||
557 | return rc; | 576 | return rc; |
558 | } | 577 | } |
559 | 578 | ||