Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
afe48c31
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
afe48c31
编写于
5月 02, 2009
作者:
S
Steve French
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CIFS] Fix final user of old string conversion code
Signed-off-by:
N
Steve French
<
sfrench@us.ibm.com
>
上级
34106027
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
38 addition
and
42 deletion
+38
-42
fs/cifs/cifssmb.c
fs/cifs/cifssmb.c
+38
-42
未找到文件。
fs/cifs/cifssmb.c
浏览文件 @
afe48c31
...
...
@@ -2564,7 +2564,6 @@ validate_ntransact(char *buf, char **ppparm, char **ppdata,
*
pparmlen
=
parm_count
;
return
0
;
}
#endif
/* CIFS_EXPERIMENTAL */
int
CIFSSMBQueryReparseLinkInfo
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
...
...
@@ -2611,59 +2610,55 @@ CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon,
}
else
{
/* decode response */
__u32
data_offset
=
le32_to_cpu
(
pSMBr
->
DataOffset
);
__u32
data_count
=
le32_to_cpu
(
pSMBr
->
DataCount
);
if
((
pSMBr
->
ByteCount
<
2
)
||
(
data_offset
>
512
))
if
((
pSMBr
->
ByteCount
<
2
)
||
(
data_offset
>
512
))
{
/* BB also check enough total bytes returned */
rc
=
-
EIO
;
/* bad smb */
else
{
if
(
data_count
&&
(
data_count
<
2048
))
{
char
*
end_of_smb
=
2
/* sizeof byte count */
+
pSMBr
->
ByteCount
+
(
char
*
)
&
pSMBr
->
ByteCount
;
goto
qreparse_out
;
}
if
(
data_count
&&
(
data_count
<
2048
))
{
char
*
end_of_smb
=
2
/* sizeof byte count */
+
pSMBr
->
ByteCount
+
(
char
*
)
&
pSMBr
->
ByteCount
;
struct
reparse_data
*
reparse_buf
=
struct
reparse_data
*
reparse_buf
=
(
struct
reparse_data
*
)
((
char
*
)
&
pSMBr
->
hdr
.
Protocol
+
data_offset
);
if
((
char
*
)
reparse_buf
>=
end_of_smb
)
{
rc
=
-
EIO
;
goto
qreparse_out
;
}
if
((
reparse_buf
->
LinkNamesBuf
+
reparse_buf
->
TargetNameOffset
+
reparse_buf
->
TargetNameLen
)
>
end_of_smb
)
{
cFYI
(
1
,
(
"reparse buf beyond SMB"
));
rc
=
-
EIO
;
goto
qreparse_out
;
}
if
((
char
*
)
reparse_buf
>=
end_of_smb
)
{
rc
=
-
EIO
;
goto
qreparse_out
;
}
if
((
reparse_buf
->
LinkNamesBuf
+
reparse_buf
->
TargetNameOffset
+
reparse_buf
->
TargetNameLen
)
>
end_of_smb
)
{
cFYI
(
1
,
(
"reparse buf beyond SMB"
));
rc
=
-
EIO
;
goto
qreparse_out
;
}
if
(
pSMBr
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
UniStrnlen
((
wchar_t
*
)
if
(
pSMBr
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
cifs_from_ucs2
(
symlinkinfo
,
(
__le16
*
)
(
reparse_buf
->
LinkNamesBuf
+
reparse_buf
->
TargetNameOffset
),
min
(
buflen
/
2
,
reparse_buf
->
TargetNameLen
/
2
));
cifs_strfromUCS_le
(
symlinkinfo
,
(
__le16
*
)
(
reparse_buf
->
LinkNamesBuf
+
reparse_buf
->
TargetNameOffset
),
name_len
,
nls_codepage
);
}
else
{
/* ASCII names */
strncpy
(
symlinkinfo
,
reparse_buf
->
LinkNamesBuf
+
reparse_buf
->
TargetNameOffset
,
min_t
(
const
int
,
buflen
,
reparse_buf
->
TargetNameLen
));
}
}
else
{
rc
=
-
EIO
;
cFYI
(
1
,
(
"Invalid return data count on "
"get reparse info ioctl"
));
buflen
,
reparse_buf
->
TargetNameLen
,
nls_codepage
,
0
);
}
else
{
/* ASCII names */
strncpy
(
symlinkinfo
,
reparse_buf
->
LinkNamesBuf
+
reparse_buf
->
TargetNameOffset
,
min_t
(
const
int
,
buflen
,
reparse_buf
->
TargetNameLen
));
}
symlinkinfo
[
buflen
]
=
0
;
/* just in case so the caller
does not go off the end of the buffer */
cFYI
(
1
,
(
"readlink result - %s"
,
symlinkinfo
));
}
else
{
rc
=
-
EIO
;
cFYI
(
1
,
(
"Invalid return data count on "
"get reparse info ioctl"
));
}
symlinkinfo
[
buflen
]
=
0
;
/* just in case so the caller
does not go off the end of the buffer */
cFYI
(
1
,
(
"readlink result - %s"
,
symlinkinfo
));
}
qreparse_out:
cifs_buf_release
(
pSMB
);
...
...
@@ -2672,6 +2667,7 @@ CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon,
return
rc
;
}
#endif
/* CIFS_EXPERIMENTAL */
#ifdef CONFIG_CIFS_POSIX
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录