Commit 4f75e546 authored by Vitaly Lipatov's avatar Vitaly Lipatov

update 3.2 up to v3.2.98

parent dcdfaeb3
...@@ -764,6 +764,9 @@ CIFSSMBEcho(struct TCP_Server_Info *server) ...@@ -764,6 +764,9 @@ CIFSSMBEcho(struct TCP_Server_Info *server)
if (rc) if (rc)
return rc; return rc;
if (server->capabilities & CAP_UNICODE)
smb->hdr.Flags2 |= SMBFLG2_UNICODE;
/* set up echo request */ /* set up echo request */
smb->hdr.Tid = 0xffff; smb->hdr.Tid = 0xffff;
smb->hdr.WordCount = 1; smb->hdr.WordCount = 1;
...@@ -3913,13 +3916,12 @@ CIFSSMBSetCIFSACL(const int xid, struct cifs_tcon *tcon, __u16 fid, ...@@ -3913,13 +3916,12 @@ CIFSSMBSetCIFSACL(const int xid, struct cifs_tcon *tcon, __u16 fid,
int rc = 0; int rc = 0;
int bytes_returned = 0; int bytes_returned = 0;
SET_SEC_DESC_REQ *pSMB = NULL; SET_SEC_DESC_REQ *pSMB = NULL;
NTRANSACT_RSP *pSMBr = NULL; void *pSMBr;
setCifsAclRetry: setCifsAclRetry:
rc = smb_init(SMB_COM_NT_TRANSACT, 19, tcon, (void **) &pSMB, rc = smb_init(SMB_COM_NT_TRANSACT, 19, tcon, (void **) &pSMB, &pSMBr);
(void **) &pSMBr);
if (rc) if (rc)
return (rc); return rc;
pSMB->MaxSetupCount = 0; pSMB->MaxSetupCount = 0;
pSMB->Reserved = 0; pSMB->Reserved = 0;
...@@ -3947,9 +3949,8 @@ setCifsAclRetry: ...@@ -3947,9 +3949,8 @@ setCifsAclRetry:
pSMB->AclFlags = cpu_to_le32(aclflag); pSMB->AclFlags = cpu_to_le32(aclflag);
if (pntsd && acllen) { if (pntsd && acllen) {
memcpy((char *) &pSMBr->hdr.Protocol + data_offset, memcpy((char *)pSMBr + offsetof(struct smb_hdr, Protocol) +
(char *) pntsd, data_offset, pntsd, acllen);
acllen);
inc_rfc1001_len(pSMB, byte_count + data_count); inc_rfc1001_len(pSMB, byte_count + data_count);
} else } else
inc_rfc1001_len(pSMB, byte_count); inc_rfc1001_len(pSMB, byte_count);
...@@ -5728,7 +5729,8 @@ CIFSSMBSetFileInfo(const int xid, struct cifs_tcon *tcon, ...@@ -5728,7 +5729,8 @@ CIFSSMBSetFileInfo(const int xid, struct cifs_tcon *tcon,
param_offset = offsetof(struct smb_com_transaction2_sfi_req, Fid) - 4; param_offset = offsetof(struct smb_com_transaction2_sfi_req, Fid) - 4;
offset = param_offset + params; offset = param_offset + params;
data_offset = (char *) (&pSMB->hdr.Protocol) + offset; data_offset = (char *)pSMB +
offsetof(struct smb_hdr, Protocol) + offset;
count = sizeof(FILE_BASIC_INFO); count = sizeof(FILE_BASIC_INFO);
pSMB->MaxParameterCount = cpu_to_le16(2); pSMB->MaxParameterCount = cpu_to_le16(2);
...@@ -5997,7 +5999,7 @@ CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon, ...@@ -5997,7 +5999,7 @@ CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon,
u16 fid, u32 pid_of_opener) u16 fid, u32 pid_of_opener)
{ {
struct smb_com_transaction2_sfi_req *pSMB = NULL; struct smb_com_transaction2_sfi_req *pSMB = NULL;
FILE_UNIX_BASIC_INFO *data_offset; char *data_offset;
int rc = 0; int rc = 0;
u16 params, param_offset, offset, byte_count, count; u16 params, param_offset, offset, byte_count, count;
...@@ -6019,8 +6021,9 @@ CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon, ...@@ -6019,8 +6021,9 @@ CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon,
param_offset = offsetof(struct smb_com_transaction2_sfi_req, Fid) - 4; param_offset = offsetof(struct smb_com_transaction2_sfi_req, Fid) - 4;
offset = param_offset + params; offset = param_offset + params;
data_offset = (FILE_UNIX_BASIC_INFO *) data_offset = (char *)pSMB +
((char *)(&pSMB->hdr.Protocol) + offset); offsetof(struct smb_hdr, Protocol) + offset;
count = sizeof(FILE_UNIX_BASIC_INFO); count = sizeof(FILE_UNIX_BASIC_INFO);
pSMB->MaxParameterCount = cpu_to_le16(2); pSMB->MaxParameterCount = cpu_to_le16(2);
...@@ -6042,7 +6045,7 @@ CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon, ...@@ -6042,7 +6045,7 @@ CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon,
inc_rfc1001_len(pSMB, byte_count); inc_rfc1001_len(pSMB, byte_count);
pSMB->ByteCount = cpu_to_le16(byte_count); pSMB->ByteCount = cpu_to_le16(byte_count);
cifs_fill_unix_set_info(data_offset, args); cifs_fill_unix_set_info((FILE_UNIX_BASIC_INFO *)data_offset, args);
rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0);
if (rc) if (rc)
......
...@@ -523,6 +523,14 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, ...@@ -523,6 +523,14 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
oplock = pTcon->ses->server->oplocks ? REQ_OPLOCK : 0; oplock = pTcon->ses->server->oplocks ? REQ_OPLOCK : 0;
/* Don't allow path components longer than the server max. */
if (unlikely(pTcon->fsAttrInfo.MaxPathNameComponentLength &&
direntry->d_name.len >
le32_to_cpu(pTcon->fsAttrInfo.MaxPathNameComponentLength))) {
rc = -ENAMETOOLONG;
goto lookup_out;
}
/* /*
* Don't allow the separator character in a path component. * Don't allow the separator character in a path component.
* The VFS will not allow "/", but "\" is allowed by posix. * The VFS will not allow "/", but "\" is allowed by posix.
......
...@@ -1948,7 +1948,7 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs) ...@@ -1948,7 +1948,7 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM)
attrs->ia_valid |= ATTR_FORCE; attrs->ia_valid |= ATTR_FORCE;
rc = inode_change_ok(inode, attrs); rc = setattr_prepare(direntry, attrs);
if (rc < 0) if (rc < 0)
goto out; goto out;
...@@ -2089,7 +2089,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs) ...@@ -2089,7 +2089,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM)
attrs->ia_valid |= ATTR_FORCE; attrs->ia_valid |= ATTR_FORCE;
rc = inode_change_ok(inode, attrs); rc = setattr_prepare(direntry, attrs);
if (rc < 0) { if (rc < 0) {
FreeXid(xid); FreeXid(xid);
return rc; return rc;
......
...@@ -974,10 +974,10 @@ struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset) ...@@ -974,10 +974,10 @@ struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset)
cERROR(1, "illegal hours %d", st->Hours); cERROR(1, "illegal hours %d", st->Hours);
days = sd->Day; days = sd->Day;
month = sd->Month; month = sd->Month;
if ((days > 31) || (month > 12)) { if (days < 1 || days > 31 || month < 1 || month > 12) {
cERROR(1, "illegal date, month %d day: %d", month, days); cERROR(1, "illegal date, month %d day: %d", month, days);
if (month > 12) days = clamp(days, 1, 31);
month = 12; month = clamp(month, 1, 12);
} }
month -= 1; month -= 1;
days += total_days_of_prev_months[month]; days += total_days_of_prev_months[month];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment