diff options
Diffstat (limited to 'fs/cifs/smb1ops.c')
-rw-r--r-- | fs/cifs/smb1ops.c | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c index 3efdb9d5c0b8..60943978aec3 100644 --- a/fs/cifs/smb1ops.c +++ b/fs/cifs/smb1ops.c | |||
@@ -449,8 +449,7 @@ cifs_negotiate_wsize(struct cifs_tcon *tcon, struct smb_vol *volume_info) | |||
449 | * WRITEX header, not including the 4 byte RFC1001 length. | 449 | * WRITEX header, not including the 4 byte RFC1001 length. |
450 | */ | 450 | */ |
451 | if (!(server->capabilities & CAP_LARGE_WRITE_X) || | 451 | if (!(server->capabilities & CAP_LARGE_WRITE_X) || |
452 | (!(server->capabilities & CAP_UNIX) && | 452 | (!(server->capabilities & CAP_UNIX) && server->sign)) |
453 | (server->sec_mode & (SECMODE_SIGN_ENABLED|SECMODE_SIGN_REQUIRED)))) | ||
454 | wsize = min_t(unsigned int, wsize, | 453 | wsize = min_t(unsigned int, wsize, |
455 | server->maxBuf - sizeof(WRITE_REQ) + 4); | 454 | server->maxBuf - sizeof(WRITE_REQ) + 4); |
456 | 455 | ||
@@ -675,20 +674,23 @@ cifs_mkdir_setinfo(struct inode *inode, const char *full_path, | |||
675 | } | 674 | } |
676 | 675 | ||
677 | static int | 676 | static int |
678 | cifs_open_file(const unsigned int xid, struct cifs_tcon *tcon, const char *path, | 677 | cifs_open_file(const unsigned int xid, struct cifs_open_parms *oparms, |
679 | int disposition, int desired_access, int create_options, | 678 | __u32 *oplock, FILE_ALL_INFO *buf) |
680 | struct cifs_fid *fid, __u32 *oplock, FILE_ALL_INFO *buf, | 679 | { |
681 | struct cifs_sb_info *cifs_sb) | 680 | if (!(oparms->tcon->ses->capabilities & CAP_NT_SMBS)) |
682 | { | 681 | return SMBLegacyOpen(xid, oparms->tcon, oparms->path, |
683 | if (!(tcon->ses->capabilities & CAP_NT_SMBS)) | 682 | oparms->disposition, |
684 | return SMBLegacyOpen(xid, tcon, path, disposition, | 683 | oparms->desired_access, |
685 | desired_access, create_options, | 684 | oparms->create_options, |
686 | &fid->netfid, oplock, buf, | 685 | &oparms->fid->netfid, oplock, buf, |
687 | cifs_sb->local_nls, cifs_sb->mnt_cifs_flags | 686 | oparms->cifs_sb->local_nls, |
687 | oparms->cifs_sb->mnt_cifs_flags | ||
688 | & CIFS_MOUNT_MAP_SPECIAL_CHR); | 688 | & CIFS_MOUNT_MAP_SPECIAL_CHR); |
689 | return CIFSSMBOpen(xid, tcon, path, disposition, desired_access, | 689 | return CIFSSMBOpen(xid, oparms->tcon, oparms->path, |
690 | create_options, &fid->netfid, oplock, buf, | 690 | oparms->disposition, oparms->desired_access, |
691 | cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & | 691 | oparms->create_options, &oparms->fid->netfid, oplock, |
692 | buf, oparms->cifs_sb->local_nls, | ||
693 | oparms->cifs_sb->mnt_cifs_flags & | ||
692 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 694 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
693 | } | 695 | } |
694 | 696 | ||
@@ -765,20 +767,14 @@ smb_set_file_info(struct inode *inode, const char *full_path, | |||
765 | } | 767 | } |
766 | tcon = tlink_tcon(tlink); | 768 | tcon = tlink_tcon(tlink); |
767 | 769 | ||
768 | /* | 770 | rc = CIFSSMBSetPathInfo(xid, tcon, full_path, buf, cifs_sb->local_nls, |
769 | * NT4 apparently returns success on this call, but it doesn't really | ||
770 | * work. | ||
771 | */ | ||
772 | if (!(tcon->ses->flags & CIFS_SES_NT4)) { | ||
773 | rc = CIFSSMBSetPathInfo(xid, tcon, full_path, buf, | ||
774 | cifs_sb->local_nls, | ||
775 | cifs_sb->mnt_cifs_flags & | 771 | cifs_sb->mnt_cifs_flags & |
776 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 772 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
777 | if (rc == 0) { | 773 | if (rc == 0) { |
778 | cinode->cifsAttrs = le32_to_cpu(buf->Attributes); | 774 | cinode->cifsAttrs = le32_to_cpu(buf->Attributes); |
779 | goto out; | 775 | goto out; |
780 | } else if (rc != -EOPNOTSUPP && rc != -EINVAL) | 776 | } else if (rc != -EOPNOTSUPP && rc != -EINVAL) { |
781 | goto out; | 777 | goto out; |
782 | } | 778 | } |
783 | 779 | ||
784 | cifs_dbg(FYI, "calling SetFileInfo since SetPathInfo for times not supported by this server\n"); | 780 | cifs_dbg(FYI, "calling SetFileInfo since SetPathInfo for times not supported by this server\n"); |
@@ -948,6 +944,7 @@ struct smb_version_operations smb1_operations = { | |||
948 | .mand_lock = cifs_mand_lock, | 944 | .mand_lock = cifs_mand_lock, |
949 | .mand_unlock_range = cifs_unlock_range, | 945 | .mand_unlock_range = cifs_unlock_range, |
950 | .push_mand_locks = cifs_push_mandatory_locks, | 946 | .push_mand_locks = cifs_push_mandatory_locks, |
947 | .query_mf_symlink = open_query_close_cifs_symlink, | ||
951 | }; | 948 | }; |
952 | 949 | ||
953 | struct smb_version_values smb1_values = { | 950 | struct smb_version_values smb1_values = { |
@@ -964,4 +961,6 @@ struct smb_version_values smb1_values = { | |||
964 | .cap_nt_find = CAP_NT_SMBS | CAP_NT_FIND, | 961 | .cap_nt_find = CAP_NT_SMBS | CAP_NT_FIND, |
965 | .cap_large_files = CAP_LARGE_FILES, | 962 | .cap_large_files = CAP_LARGE_FILES, |
966 | .oplock_read = OPLOCK_READ, | 963 | .oplock_read = OPLOCK_READ, |
964 | .signing_enabled = SECMODE_SIGN_ENABLED, | ||
965 | .signing_required = SECMODE_SIGN_REQUIRED, | ||
967 | }; | 966 | }; |