提交 f6928b5c 编写于 作者: M Marios Makassikis 提交者: Zhong Jinghua

ksmbd: Remove unused parameter from smb2_get_name()

mainline inclusion
from mainline-5.17-rc1
commit 80917f17
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G
CVE: NA

Reference: https://git.kernel.org/torvalds/linux/c/80917f17e3f9

-------------------------------

The 'share' parameter is no longer used by smb2_get_name() since
commit 265fd199 ("ksmbd: use LOOKUP_BENEATH to prevent the out of
share access").
Acked-by: NNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: NMarios Makassikis <mmakassikis@freebox.fr>
Signed-off-by: NSteve French <stfrench@microsoft.com>
Signed-off-by: NJason Yan <yanaijie@huawei.com>
Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
上级 9d6c7705
......@@ -611,7 +611,6 @@ static void destroy_previous_session(struct ksmbd_user *user, u64 id)
/**
* smb2_get_name() - get filename string from on the wire smb format
* @share: ksmbd_share_config pointer
* @src: source buffer
* @maxlen: maxlen of source string
* @nls_table: nls_table pointer
......@@ -619,8 +618,7 @@ static void destroy_previous_session(struct ksmbd_user *user, u64 id)
* Return: matching converted filename on success, otherwise error ptr
*/
static char *
smb2_get_name(struct ksmbd_share_config *share, const char *src,
const int maxlen, struct nls_table *local_nls)
smb2_get_name(const char *src, const int maxlen, struct nls_table *local_nls)
{
char *name;
......@@ -2518,8 +2516,7 @@ int smb2_open(struct ksmbd_work *work)
goto err_out1;
}
name = smb2_get_name(share,
req->Buffer,
name = smb2_get_name(req->Buffer,
le16_to_cpu(req->NameLength),
work->conn->local_nls);
if (IS_ERR(name)) {
......@@ -5350,8 +5347,7 @@ static int smb2_rename(struct ksmbd_work *work, struct ksmbd_file *fp,
goto out;
}
new_name = smb2_get_name(share,
file_info->FileName,
new_name = smb2_get_name(file_info->FileName,
le32_to_cpu(file_info->FileNameLength),
local_nls);
if (IS_ERR(new_name)) {
......@@ -5461,8 +5457,7 @@ static int smb2_create_link(struct ksmbd_work *work,
if (!pathname)
return -ENOMEM;
link_name = smb2_get_name(share,
file_info->FileName,
link_name = smb2_get_name(file_info->FileName,
le32_to_cpu(file_info->FileNameLength),
local_nls);
if (IS_ERR(link_name) || S_ISDIR(file_inode(filp)->i_mode)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册