Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
b1a45695
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
b1a45695
编写于
19年前
作者:
S
Steve French
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CIFS] fix casts of unicode strings to match function definition
Signed-off-by: Steve French (sfrench@us.ibm.com)
上级
b2aeb9d5
无相关合并请求
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
29 addition
and
29 deletion
+29
-29
fs/cifs/cifsproto.h
fs/cifs/cifsproto.h
+1
-1
fs/cifs/cifssmb.c
fs/cifs/cifssmb.c
+28
-28
未找到文件。
fs/cifs/cifsproto.h
浏览文件 @
b1a45695
...
...
@@ -228,7 +228,7 @@ extern int CIFSGetSrvInodeNumber(const int xid, struct cifsTconInfo *tcon,
const
struct
nls_table
*
nls_codepage
,
int
remap_special_chars
);
#endif
/* CONFIG_CIFS_EXPERIMENTAL */
extern
int
cifs_convertUCSpath
(
char
*
target
,
const
__
u
16
*
source
,
int
maxlen
,
extern
int
cifs_convertUCSpath
(
char
*
target
,
const
__
le
16
*
source
,
int
maxlen
,
const
struct
nls_table
*
codepage
);
extern
int
cifsConvertToUCS
(
__le16
*
target
,
const
char
*
source
,
int
maxlen
,
const
struct
nls_table
*
cp
,
int
mapChars
);
...
...
This diff is collapsed.
Click to expand it.
fs/cifs/cifssmb.c
浏览文件 @
b1a45695
...
...
@@ -567,7 +567,7 @@ CIFSSMBDelFile(const int xid, struct cifsTconInfo *tcon, const char *fileName,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
fileName
,
fileName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
fileName
,
fileName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
*=
2
;
...
...
@@ -665,7 +665,7 @@ CIFSSMBMkDir(const int xid, struct cifsTconInfo *tcon,
return
rc
;
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
DirName
,
name
,
name_len
=
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
DirName
,
name
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
*=
2
;
...
...
@@ -719,7 +719,7 @@ CIFSSMBOpen(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
count
=
1
;
/* account for one byte pad to word boundary */
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
(
pSMB
->
fileName
+
1
),
cifsConvertToUCS
((
__
le
16
*
)
(
pSMB
->
fileName
+
1
),
fileName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
*=
2
;
...
...
@@ -1141,7 +1141,7 @@ CIFSSMBRename(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
OldFileName
,
fromName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
OldFileName
,
fromName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
*=
2
;
...
...
@@ -1149,7 +1149,7 @@ CIFSSMBRename(const int xid, struct cifsTconInfo *tcon,
/* protocol requires ASCII signature byte on Unicode string */
pSMB
->
OldFileName
[
name_len
+
1
]
=
0x00
;
name_len2
=
cifsConvertToUCS
((
__
u
16
*
)
&
pSMB
->
OldFileName
[
name_len
+
2
],
cifsConvertToUCS
((
__
le
16
*
)
&
pSMB
->
OldFileName
[
name_len
+
2
],
toName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len2
+=
1
/* trailing null */
+
1
/* Signature word */
;
name_len2
*=
2
;
/* convert to bytes */
...
...
@@ -1236,10 +1236,10 @@ int CIFSSMBRenameOpenFile(const int xid,struct cifsTconInfo *pTcon,
/* unicode only call */
if
(
target_name
==
NULL
)
{
sprintf
(
dummy_string
,
"cifs%x"
,
pSMB
->
hdr
.
Mid
);
len_of_str
=
cifsConvertToUCS
((
__
u
16
*
)
rename_info
->
target_name
,
len_of_str
=
cifsConvertToUCS
((
__
le
16
*
)
rename_info
->
target_name
,
dummy_string
,
24
,
nls_codepage
,
remap
);
}
else
{
len_of_str
=
cifsConvertToUCS
((
__
u
16
*
)
rename_info
->
target_name
,
len_of_str
=
cifsConvertToUCS
((
__
le
16
*
)
rename_info
->
target_name
,
target_name
,
PATH_MAX
,
nls_codepage
,
remap
);
}
rename_info
->
target_name_len
=
cpu_to_le32
(
2
*
len_of_str
);
...
...
@@ -1296,7 +1296,7 @@ CIFSSMBCopy(const int xid, struct cifsTconInfo *tcon, const char * fromName,
pSMB
->
Flags
=
cpu_to_le16
(
flags
&
COPY_TREE
);
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
OldFileName
,
name_len
=
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
OldFileName
,
fromName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
...
...
@@ -1304,7 +1304,7 @@ CIFSSMBCopy(const int xid, struct cifsTconInfo *tcon, const char * fromName,
pSMB
->
OldFileName
[
name_len
]
=
0x04
;
/* pad */
/* protocol requires ASCII signature byte on Unicode string */
pSMB
->
OldFileName
[
name_len
+
1
]
=
0x00
;
name_len2
=
cifsConvertToUCS
((
__
u
16
*
)
&
pSMB
->
OldFileName
[
name_len
+
2
],
name_len2
=
cifsConvertToUCS
((
__
le
16
*
)
&
pSMB
->
OldFileName
[
name_len
+
2
],
toName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len2
+=
1
/* trailing null */
+
1
/* Signature word */
;
name_len2
*=
2
;
/* convert to bytes */
...
...
@@ -1453,7 +1453,7 @@ CIFSUnixCreateHardLink(const int xid, struct cifsTconInfo *tcon,
return
rc
;
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
toName
,
name_len
=
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
toName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
*=
2
;
...
...
@@ -1476,7 +1476,7 @@ CIFSUnixCreateHardLink(const int xid, struct cifsTconInfo *tcon,
data_offset
=
(
char
*
)
(
&
pSMB
->
hdr
.
Protocol
)
+
offset
;
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len_target
=
cifsConvertToUCS
((
__
u
16
*
)
data_offset
,
fromName
,
PATH_MAX
,
cifsConvertToUCS
((
__
le
16
*
)
data_offset
,
fromName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len_target
++
;
/* trailing null */
name_len_target
*=
2
;
...
...
@@ -1546,14 +1546,14 @@ CIFSCreateHardLink(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
OldFileName
,
fromName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
OldFileName
,
fromName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
*=
2
;
pSMB
->
OldFileName
[
name_len
]
=
0
;
/* pad */
pSMB
->
OldFileName
[
name_len
+
1
]
=
0x04
;
name_len2
=
cifsConvertToUCS
((
__
u
16
*
)
&
pSMB
->
OldFileName
[
name_len
+
2
],
cifsConvertToUCS
((
__
le
16
*
)
&
pSMB
->
OldFileName
[
name_len
+
2
],
toName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len2
+=
1
/* trailing null */
+
1
/* Signature word */
;
name_len2
*=
2
;
/* convert to bytes */
...
...
@@ -1939,7 +1939,7 @@ CIFSSMBGetPosixACL(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
searchName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
searchName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
*=
2
;
...
...
@@ -2024,7 +2024,7 @@ CIFSSMBSetPosixACL(const int xid, struct cifsTconInfo *tcon,
return
rc
;
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
fileName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
fileName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
*=
2
;
...
...
@@ -2188,7 +2188,7 @@ CIFSSMBQPathInfo(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
searchName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
searchName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
*=
2
;
...
...
@@ -2269,7 +2269,7 @@ CIFSSMBUnixQPathInfo(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
searchName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
searchName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
*=
2
;
...
...
@@ -2350,7 +2350,7 @@ int CIFSFindSingle(const int xid, struct cifsTconInfo *tcon,
if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
name_len =
cifsConvertToUCS((
wchar_t
*) pSMB->FileName, searchName, PATH_MAX
cifsConvertToUCS((
__le16
*) pSMB->FileName, searchName, PATH_MAX
/* find define for this maxpathcomponent */
, nls_codepage);
name_len++; /* trailing null */
...
...
@@ -2435,7 +2435,7 @@ CIFSFindFirst(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
searchName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
searchName
,
PATH_MAX
,
nls_codepage
,
remap
);
/* We can not add the asterik earlier in case
it got remapped to 0xF03A as if it were part of the
...
...
@@ -2726,7 +2726,7 @@ CIFSGetSrvInodeNumber(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
searchName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
searchName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
*=
2
;
...
...
@@ -2837,7 +2837,7 @@ CIFSGetDFSRefer(const int xid, struct cifsSesInfo *ses,
if
(
ses
->
capabilities
&
CAP_UNICODE
)
{
pSMB
->
hdr
.
Flags2
|=
SMBFLG2_UNICODE
;
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
RequestFileName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
RequestFileName
,
searchName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
*=
2
;
...
...
@@ -3369,7 +3369,7 @@ CIFSSMBSetEOF(const int xid, struct cifsTconInfo *tcon, const char *fileName,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
fileName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
fileName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
*=
2
;
...
...
@@ -3627,7 +3627,7 @@ CIFSSMBSetTimes(const int xid, struct cifsTconInfo *tcon, const char *fileName,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
fileName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
fileName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
*=
2
;
...
...
@@ -3708,7 +3708,7 @@ CIFSSMBSetAttrLegacy(int xid, struct cifsTconInfo *tcon, char *fileName,
if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
name_len =
ConvertToUCS((
wchar_t
*) pSMB->fileName, fileName,
ConvertToUCS((
__le16
*) pSMB->fileName, fileName,
PATH_MAX, nls_codepage);
name_len++; /* trailing null */
name_len *= 2;
...
...
@@ -3759,7 +3759,7 @@ CIFSSMBUnixSetPerms(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
fileName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
fileName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
*=
2
;
...
...
@@ -3904,7 +3904,7 @@ CIFSSMBQAllEAs(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
cifsConvertToUCS
((
wchar_t
*
)
pSMB
->
FileName
,
searchName
,
cifsConvertToUCS
((
__le16
*
)
pSMB
->
FileName
,
searchName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
*=
2
;
...
...
@@ -4047,7 +4047,7 @@ ssize_t CIFSSMBQueryEA(const int xid,struct cifsTconInfo * tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
searchName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
searchName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
*=
2
;
...
...
@@ -4194,7 +4194,7 @@ CIFSSMBSetEA(const int xid, struct cifsTconInfo *tcon, const char *fileName,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
fileName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
fileName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
*=
2
;
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
反馈
建议
客服
返回
顶部