Loading fs/cifs/cifsglob.h +3 −0 Original line number Diff line number Diff line Loading @@ -253,6 +253,9 @@ struct smb_version_operations { void (*mkdir_setinfo)(struct inode *, const char *, struct cifs_sb_info *, struct cifs_tcon *, const unsigned int); /* remove directory */ int (*rmdir)(const unsigned int, struct cifs_tcon *, const char *, struct cifs_sb_info *); }; struct smb_version_values { Loading fs/cifs/cifsproto.h +1 −2 Original line number Diff line number Diff line Loading @@ -297,8 +297,7 @@ extern int CIFSSMBUnixSetPathInfo(const unsigned int xid, extern int CIFSSMBMkDir(const unsigned int xid, struct cifs_tcon *tcon, const char *name, struct cifs_sb_info *cifs_sb); extern int CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon, const char *name, const struct nls_table *nls_codepage, int remap_special_chars); const char *name, struct cifs_sb_info *cifs_sb); extern int CIFSPOSIXDelFile(const unsigned int xid, struct cifs_tcon *tcon, const char *name, __u16 type, const struct nls_table *nls_codepage, Loading fs/cifs/cifssmb.c +8 −7 Original line number Diff line number Diff line Loading @@ -948,15 +948,15 @@ CIFSSMBDelFile(const unsigned int xid, struct cifs_tcon *tcon, } int CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon, const char *dirName, const struct nls_table *nls_codepage, int remap) CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon, const char *name, struct cifs_sb_info *cifs_sb) { DELETE_DIRECTORY_REQ *pSMB = NULL; DELETE_DIRECTORY_RSP *pSMBr = NULL; int rc = 0; int bytes_returned; int name_len; int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; cFYI(1, "In CIFSSMBRmDir"); RmDirRetry: Loading @@ -966,14 +966,15 @@ CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon, return rc; if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { name_len = cifsConvertToUTF16((__le16 *) pSMB->DirName, dirName, PATH_MAX, nls_codepage, remap); name_len = cifsConvertToUTF16((__le16 *) pSMB->DirName, name, PATH_MAX, cifs_sb->local_nls, remap); name_len++; /* trailing null */ name_len *= 2; } else { /* BB improve check for buffer overruns BB */ name_len = strnlen(dirName, PATH_MAX); name_len = strnlen(name, PATH_MAX); name_len++; /* trailing null */ strncpy(pSMB->DirName, dirName, name_len); strncpy(pSMB->DirName, name, name_len); } pSMB->BufferFormat = 0x04; Loading fs/cifs/inode.c +11 −4 Original line number Diff line number Diff line Loading @@ -1426,7 +1426,8 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry) unsigned int xid; struct cifs_sb_info *cifs_sb; struct tcon_link *tlink; struct cifs_tcon *pTcon; struct cifs_tcon *tcon; struct TCP_Server_Info *server; char *full_path = NULL; struct cifsInodeInfo *cifsInode; Loading @@ -1446,10 +1447,16 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry) rc = PTR_ERR(tlink); goto rmdir_exit; } pTcon = tlink_tcon(tlink); tcon = tlink_tcon(tlink); server = tcon->ses->server; rc = CIFSSMBRmDir(xid, pTcon, full_path, cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); if (!server->ops->rmdir) { rc = -ENOSYS; cifs_put_tlink(tlink); goto rmdir_exit; } rc = server->ops->rmdir(xid, tcon, full_path, cifs_sb); cifs_put_tlink(tlink); if (!rc) { Loading fs/cifs/smb1ops.c +1 −0 Original line number Diff line number Diff line Loading @@ -643,6 +643,7 @@ struct smb_version_operations smb1_operations = { .echo = CIFSSMBEcho, .mkdir = CIFSSMBMkDir, .mkdir_setinfo = cifs_mkdir_setinfo, .rmdir = CIFSSMBRmDir, }; struct smb_version_values smb1_values = { Loading Loading
fs/cifs/cifsglob.h +3 −0 Original line number Diff line number Diff line Loading @@ -253,6 +253,9 @@ struct smb_version_operations { void (*mkdir_setinfo)(struct inode *, const char *, struct cifs_sb_info *, struct cifs_tcon *, const unsigned int); /* remove directory */ int (*rmdir)(const unsigned int, struct cifs_tcon *, const char *, struct cifs_sb_info *); }; struct smb_version_values { Loading
fs/cifs/cifsproto.h +1 −2 Original line number Diff line number Diff line Loading @@ -297,8 +297,7 @@ extern int CIFSSMBUnixSetPathInfo(const unsigned int xid, extern int CIFSSMBMkDir(const unsigned int xid, struct cifs_tcon *tcon, const char *name, struct cifs_sb_info *cifs_sb); extern int CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon, const char *name, const struct nls_table *nls_codepage, int remap_special_chars); const char *name, struct cifs_sb_info *cifs_sb); extern int CIFSPOSIXDelFile(const unsigned int xid, struct cifs_tcon *tcon, const char *name, __u16 type, const struct nls_table *nls_codepage, Loading
fs/cifs/cifssmb.c +8 −7 Original line number Diff line number Diff line Loading @@ -948,15 +948,15 @@ CIFSSMBDelFile(const unsigned int xid, struct cifs_tcon *tcon, } int CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon, const char *dirName, const struct nls_table *nls_codepage, int remap) CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon, const char *name, struct cifs_sb_info *cifs_sb) { DELETE_DIRECTORY_REQ *pSMB = NULL; DELETE_DIRECTORY_RSP *pSMBr = NULL; int rc = 0; int bytes_returned; int name_len; int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; cFYI(1, "In CIFSSMBRmDir"); RmDirRetry: Loading @@ -966,14 +966,15 @@ CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon, return rc; if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { name_len = cifsConvertToUTF16((__le16 *) pSMB->DirName, dirName, PATH_MAX, nls_codepage, remap); name_len = cifsConvertToUTF16((__le16 *) pSMB->DirName, name, PATH_MAX, cifs_sb->local_nls, remap); name_len++; /* trailing null */ name_len *= 2; } else { /* BB improve check for buffer overruns BB */ name_len = strnlen(dirName, PATH_MAX); name_len = strnlen(name, PATH_MAX); name_len++; /* trailing null */ strncpy(pSMB->DirName, dirName, name_len); strncpy(pSMB->DirName, name, name_len); } pSMB->BufferFormat = 0x04; Loading
fs/cifs/inode.c +11 −4 Original line number Diff line number Diff line Loading @@ -1426,7 +1426,8 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry) unsigned int xid; struct cifs_sb_info *cifs_sb; struct tcon_link *tlink; struct cifs_tcon *pTcon; struct cifs_tcon *tcon; struct TCP_Server_Info *server; char *full_path = NULL; struct cifsInodeInfo *cifsInode; Loading @@ -1446,10 +1447,16 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry) rc = PTR_ERR(tlink); goto rmdir_exit; } pTcon = tlink_tcon(tlink); tcon = tlink_tcon(tlink); server = tcon->ses->server; rc = CIFSSMBRmDir(xid, pTcon, full_path, cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); if (!server->ops->rmdir) { rc = -ENOSYS; cifs_put_tlink(tlink); goto rmdir_exit; } rc = server->ops->rmdir(xid, tcon, full_path, cifs_sb); cifs_put_tlink(tlink); if (!rc) { Loading
fs/cifs/smb1ops.c +1 −0 Original line number Diff line number Diff line Loading @@ -643,6 +643,7 @@ struct smb_version_operations smb1_operations = { .echo = CIFSSMBEcho, .mkdir = CIFSSMBMkDir, .mkdir_setinfo = cifs_mkdir_setinfo, .rmdir = CIFSSMBRmDir, }; struct smb_version_values smb1_values = { Loading