Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci-2.6.23
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci-2.6.23
Commits
b1a45695
Commit
b1a45695
authored
May 17, 2005
by
Steve French
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CIFS] fix casts of unicode strings to match function definition
Signed-off-by: Steve French (sfrench@us.ibm.com)
parent
b2aeb9d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
29 deletions
+29
-29
fs/cifs/cifsproto.h
fs/cifs/cifsproto.h
+1
-1
fs/cifs/cifssmb.c
fs/cifs/cifssmb.c
+28
-28
No files found.
fs/cifs/cifsproto.h
View file @
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
);
...
...
fs/cifs/cifssmb.c
View file @
b1a45695
...
...
@@ -567,7 +567,7 @@ DelFileRetry:
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 @@ MkDirRetry:
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 @@ openRetry:
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 @@ renameRetry:
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 @@ renameRetry:
/* 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 @@ copyRetry:
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 @@ copyRetry:
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 @@ createHardLinkRetry:
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 @@ createHardLinkRetry:
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 @@ winCreateHardLinkRetry:
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 @@ queryAclRetry:
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 @@ setAclRetry:
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 @@ QPathInfoRetry:
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 @@ UnixQPathInfoRetry:
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 @@ findUniqueRetry:
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 @@ findFirstRetry:
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 @@ GetInodeNumberRetry:
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 @@ getDFSRetry:
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 @@ SetEOFRetry:
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 @@ SetTimesRetry:
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 @@ SetAttrLgcyRetry:
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 @@ setPermsRetry:
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 @@ QAllEAsRetry:
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 @@ QEARetry:
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 @@ SetEARetry:
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment