|
@@ -918,23 +918,31 @@ cifs_query_symlink(const unsigned int xid, struct cifs_tcon *tcon,
|
|
|
|
|
|
cifs_dbg(FYI, "%s: path: %s\n", __func__, full_path);
|
|
cifs_dbg(FYI, "%s: path: %s\n", __func__, full_path);
|
|
|
|
|
|
|
|
+ /* Check for unix extensions */
|
|
|
|
+ if (cap_unix(tcon->ses)) {
|
|
|
|
+ rc = CIFSSMBUnixQuerySymLink(xid, tcon, full_path, target_path,
|
|
|
|
+ cifs_sb->local_nls);
|
|
|
|
+ goto out;
|
|
|
|
+ }
|
|
|
|
+
|
|
rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN,
|
|
rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN,
|
|
FILE_READ_ATTRIBUTES, OPEN_REPARSE_POINT, &netfid,
|
|
FILE_READ_ATTRIBUTES, OPEN_REPARSE_POINT, &netfid,
|
|
&oplock, NULL, cifs_sb->local_nls,
|
|
&oplock, NULL, cifs_sb->local_nls,
|
|
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
|
|
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
|
|
if (rc)
|
|
if (rc)
|
|
- return rc;
|
|
|
|
|
|
+ goto out;
|
|
|
|
|
|
rc = CIFSSMBQuerySymLink(xid, tcon, netfid, target_path,
|
|
rc = CIFSSMBQuerySymLink(xid, tcon, netfid, target_path,
|
|
cifs_sb->local_nls);
|
|
cifs_sb->local_nls);
|
|
- if (rc) {
|
|
|
|
- CIFSSMBClose(xid, tcon, netfid);
|
|
|
|
- return rc;
|
|
|
|
- }
|
|
|
|
|
|
+ if (rc)
|
|
|
|
+ goto out_close;
|
|
|
|
|
|
convert_delimiter(*target_path, '/');
|
|
convert_delimiter(*target_path, '/');
|
|
|
|
+out_close:
|
|
CIFSSMBClose(xid, tcon, netfid);
|
|
CIFSSMBClose(xid, tcon, netfid);
|
|
- cifs_dbg(FYI, "%s: target path: %s\n", __func__, *target_path);
|
|
|
|
|
|
+out:
|
|
|
|
+ if (!rc)
|
|
|
|
+ cifs_dbg(FYI, "%s: target path: %s\n", __func__, *target_path);
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
|
|
|