Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
16a789c1
Commit
16a789c1
authored
Jun 01, 2005
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
parents
72a95d14
7e298750
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
41 deletions
+49
-41
fs/cifs/README
fs/cifs/README
+2
-2
fs/cifs/cifsproto.h
fs/cifs/cifsproto.h
+1
-1
fs/cifs/cifssmb.c
fs/cifs/cifssmb.c
+28
-28
fs/cifs/dir.c
fs/cifs/dir.c
+2
-1
fs/cifs/inode.c
fs/cifs/inode.c
+15
-9
fs/cifs/misc.c
fs/cifs/misc.c
+1
-0
No files found.
fs/cifs/README
View file @
16a789c1
...
@@ -371,7 +371,7 @@ A partial list of the supported mount options follows:
...
@@ -371,7 +371,7 @@ A partial list of the supported mount options follows:
on newly created files, directories, and devices (create,
on newly created files, directories, and devices (create,
mkdir, mknod) which will result in the server setting the
mkdir, mknod) which will result in the server setting the
uid and gid to the default (usually the server uid of the
uid and gid to the default (usually the server uid of the
user
n
who mounted the share). Letting the server (rather than
user who mounted the share). Letting the server (rather than
the client) set the uid and gid is the default. This
the client) set the uid and gid is the default. This
parameter has no effect if the CIFS Unix Extensions are not
parameter has no effect if the CIFS Unix Extensions are not
negotiated.
negotiated.
...
@@ -384,7 +384,7 @@ A partial list of the supported mount options follows:
...
@@ -384,7 +384,7 @@ A partial list of the supported mount options follows:
client (e.g. when the application is doing large sequential
client (e.g. when the application is doing large sequential
reads bigger than page size without rereading the same data)
reads bigger than page size without rereading the same data)
this can provide better performance than the default
this can provide better performance than the default
behavior which caches reads (rea
a
dahead) and writes
behavior which caches reads (readahead) and writes
(writebehind) through the local Linux client pagecache
(writebehind) through the local Linux client pagecache
if oplock (caching token) is granted and held. Note that
if oplock (caching token) is granted and held. Note that
direct allows write operations larger than page size
direct allows write operations larger than page size
...
...
fs/cifs/cifsproto.h
View file @
16a789c1
...
@@ -228,7 +228,7 @@ extern int CIFSGetSrvInodeNumber(const int xid, struct cifsTconInfo *tcon,
...
@@ -228,7 +228,7 @@ extern int CIFSGetSrvInodeNumber(const int xid, struct cifsTconInfo *tcon,
const
struct
nls_table
*
nls_codepage
,
const
struct
nls_table
*
nls_codepage
,
int
remap_special_chars
);
int
remap_special_chars
);
#endif
/* CONFIG_CIFS_EXPERIMENTAL */
#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
);
const
struct
nls_table
*
codepage
);
extern
int
cifsConvertToUCS
(
__le16
*
target
,
const
char
*
source
,
int
maxlen
,
extern
int
cifsConvertToUCS
(
__le16
*
target
,
const
char
*
source
,
int
maxlen
,
const
struct
nls_table
*
cp
,
int
mapChars
);
const
struct
nls_table
*
cp
,
int
mapChars
);
...
...
fs/cifs/cifssmb.c
View file @
16a789c1
...
@@ -567,7 +567,7 @@ CIFSSMBDelFile(const int xid, struct cifsTconInfo *tcon, const char *fileName,
...
@@ -567,7 +567,7 @@ CIFSSMBDelFile(const int xid, struct cifsTconInfo *tcon, const char *fileName,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
fileName
,
fileName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
fileName
,
fileName
,
PATH_MAX
,
nls_codepage
,
remap
);
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
++
;
/* trailing null */
name_len
*=
2
;
name_len
*=
2
;
...
@@ -665,7 +665,7 @@ CIFSSMBMkDir(const int xid, struct cifsTconInfo *tcon,
...
@@ -665,7 +665,7 @@ CIFSSMBMkDir(const int xid, struct cifsTconInfo *tcon,
return
rc
;
return
rc
;
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
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
);
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
++
;
/* trailing null */
name_len
*=
2
;
name_len
*=
2
;
...
@@ -719,7 +719,7 @@ CIFSSMBOpen(const int xid, struct cifsTconInfo *tcon,
...
@@ -719,7 +719,7 @@ CIFSSMBOpen(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
count
=
1
;
/* account for one byte pad to word boundary */
count
=
1
;
/* account for one byte pad to word boundary */
name_len
=
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
(
pSMB
->
fileName
+
1
),
cifsConvertToUCS
((
__
le
16
*
)
(
pSMB
->
fileName
+
1
),
fileName
,
PATH_MAX
,
nls_codepage
,
remap
);
fileName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
++
;
/* trailing null */
name_len
*=
2
;
name_len
*=
2
;
...
@@ -1141,7 +1141,7 @@ CIFSSMBRename(const int xid, struct cifsTconInfo *tcon,
...
@@ -1141,7 +1141,7 @@ CIFSSMBRename(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
OldFileName
,
fromName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
OldFileName
,
fromName
,
PATH_MAX
,
nls_codepage
,
remap
);
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
++
;
/* trailing null */
name_len
*=
2
;
name_len
*=
2
;
...
@@ -1149,7 +1149,7 @@ CIFSSMBRename(const int xid, struct cifsTconInfo *tcon,
...
@@ -1149,7 +1149,7 @@ CIFSSMBRename(const int xid, struct cifsTconInfo *tcon,
/* protocol requires ASCII signature byte on Unicode string */
/* protocol requires ASCII signature byte on Unicode string */
pSMB
->
OldFileName
[
name_len
+
1
]
=
0x00
;
pSMB
->
OldFileName
[
name_len
+
1
]
=
0x00
;
name_len2
=
name_len2
=
cifsConvertToUCS
((
__
u
16
*
)
&
pSMB
->
OldFileName
[
name_len
+
2
],
cifsConvertToUCS
((
__
le
16
*
)
&
pSMB
->
OldFileName
[
name_len
+
2
],
toName
,
PATH_MAX
,
nls_codepage
,
remap
);
toName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len2
+=
1
/* trailing null */
+
1
/* Signature word */
;
name_len2
+=
1
/* trailing null */
+
1
/* Signature word */
;
name_len2
*=
2
;
/* convert to bytes */
name_len2
*=
2
;
/* convert to bytes */
...
@@ -1236,10 +1236,10 @@ int CIFSSMBRenameOpenFile(const int xid,struct cifsTconInfo *pTcon,
...
@@ -1236,10 +1236,10 @@ int CIFSSMBRenameOpenFile(const int xid,struct cifsTconInfo *pTcon,
/* unicode only call */
/* unicode only call */
if
(
target_name
==
NULL
)
{
if
(
target_name
==
NULL
)
{
sprintf
(
dummy_string
,
"cifs%x"
,
pSMB
->
hdr
.
Mid
);
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
);
dummy_string
,
24
,
nls_codepage
,
remap
);
}
else
{
}
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
);
target_name
,
PATH_MAX
,
nls_codepage
,
remap
);
}
}
rename_info
->
target_name_len
=
cpu_to_le32
(
2
*
len_of_str
);
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,
...
@@ -1296,7 +1296,7 @@ CIFSSMBCopy(const int xid, struct cifsTconInfo *tcon, const char * fromName,
pSMB
->
Flags
=
cpu_to_le16
(
flags
&
COPY_TREE
);
pSMB
->
Flags
=
cpu_to_le16
(
flags
&
COPY_TREE
);
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
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
,
fromName
,
PATH_MAX
,
nls_codepage
,
remap
);
remap
);
name_len
++
;
/* trailing null */
name_len
++
;
/* trailing null */
...
@@ -1304,7 +1304,7 @@ CIFSSMBCopy(const int xid, struct cifsTconInfo *tcon, const char * fromName,
...
@@ -1304,7 +1304,7 @@ CIFSSMBCopy(const int xid, struct cifsTconInfo *tcon, const char * fromName,
pSMB
->
OldFileName
[
name_len
]
=
0x04
;
/* pad */
pSMB
->
OldFileName
[
name_len
]
=
0x04
;
/* pad */
/* protocol requires ASCII signature byte on Unicode string */
/* protocol requires ASCII signature byte on Unicode string */
pSMB
->
OldFileName
[
name_len
+
1
]
=
0x00
;
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
);
toName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len2
+=
1
/* trailing null */
+
1
/* Signature word */
;
name_len2
+=
1
/* trailing null */
+
1
/* Signature word */
;
name_len2
*=
2
;
/* convert to bytes */
name_len2
*=
2
;
/* convert to bytes */
...
@@ -1453,7 +1453,7 @@ CIFSUnixCreateHardLink(const int xid, struct cifsTconInfo *tcon,
...
@@ -1453,7 +1453,7 @@ CIFSUnixCreateHardLink(const int xid, struct cifsTconInfo *tcon,
return
rc
;
return
rc
;
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
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
);
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
++
;
/* trailing null */
name_len
*=
2
;
name_len
*=
2
;
...
@@ -1476,7 +1476,7 @@ CIFSUnixCreateHardLink(const int xid, struct cifsTconInfo *tcon,
...
@@ -1476,7 +1476,7 @@ CIFSUnixCreateHardLink(const int xid, struct cifsTconInfo *tcon,
data_offset
=
(
char
*
)
(
&
pSMB
->
hdr
.
Protocol
)
+
offset
;
data_offset
=
(
char
*
)
(
&
pSMB
->
hdr
.
Protocol
)
+
offset
;
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len_target
=
name_len_target
=
cifsConvertToUCS
((
__
u
16
*
)
data_offset
,
fromName
,
PATH_MAX
,
cifsConvertToUCS
((
__
le
16
*
)
data_offset
,
fromName
,
PATH_MAX
,
nls_codepage
,
remap
);
nls_codepage
,
remap
);
name_len_target
++
;
/* trailing null */
name_len_target
++
;
/* trailing null */
name_len_target
*=
2
;
name_len_target
*=
2
;
...
@@ -1546,14 +1546,14 @@ CIFSCreateHardLink(const int xid, struct cifsTconInfo *tcon,
...
@@ -1546,14 +1546,14 @@ CIFSCreateHardLink(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
OldFileName
,
fromName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
OldFileName
,
fromName
,
PATH_MAX
,
nls_codepage
,
remap
);
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
++
;
/* trailing null */
name_len
*=
2
;
name_len
*=
2
;
pSMB
->
OldFileName
[
name_len
]
=
0
;
/* pad */
pSMB
->
OldFileName
[
name_len
]
=
0
;
/* pad */
pSMB
->
OldFileName
[
name_len
+
1
]
=
0x04
;
pSMB
->
OldFileName
[
name_len
+
1
]
=
0x04
;
name_len2
=
name_len2
=
cifsConvertToUCS
((
__
u
16
*
)
&
pSMB
->
OldFileName
[
name_len
+
2
],
cifsConvertToUCS
((
__
le
16
*
)
&
pSMB
->
OldFileName
[
name_len
+
2
],
toName
,
PATH_MAX
,
nls_codepage
,
remap
);
toName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len2
+=
1
/* trailing null */
+
1
/* Signature word */
;
name_len2
+=
1
/* trailing null */
+
1
/* Signature word */
;
name_len2
*=
2
;
/* convert to bytes */
name_len2
*=
2
;
/* convert to bytes */
...
@@ -1939,7 +1939,7 @@ CIFSSMBGetPosixACL(const int xid, struct cifsTconInfo *tcon,
...
@@ -1939,7 +1939,7 @@ CIFSSMBGetPosixACL(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
searchName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
searchName
,
PATH_MAX
,
nls_codepage
,
remap
);
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
++
;
/* trailing null */
name_len
*=
2
;
name_len
*=
2
;
...
@@ -2024,7 +2024,7 @@ CIFSSMBSetPosixACL(const int xid, struct cifsTconInfo *tcon,
...
@@ -2024,7 +2024,7 @@ CIFSSMBSetPosixACL(const int xid, struct cifsTconInfo *tcon,
return
rc
;
return
rc
;
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
fileName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
fileName
,
PATH_MAX
,
nls_codepage
,
remap
);
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
++
;
/* trailing null */
name_len
*=
2
;
name_len
*=
2
;
...
@@ -2188,7 +2188,7 @@ CIFSSMBQPathInfo(const int xid, struct cifsTconInfo *tcon,
...
@@ -2188,7 +2188,7 @@ CIFSSMBQPathInfo(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
searchName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
searchName
,
PATH_MAX
,
nls_codepage
,
remap
);
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
++
;
/* trailing null */
name_len
*=
2
;
name_len
*=
2
;
...
@@ -2269,7 +2269,7 @@ CIFSSMBUnixQPathInfo(const int xid, struct cifsTconInfo *tcon,
...
@@ -2269,7 +2269,7 @@ CIFSSMBUnixQPathInfo(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
searchName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
searchName
,
PATH_MAX
,
nls_codepage
,
remap
);
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
++
;
/* trailing null */
name_len
*=
2
;
name_len
*=
2
;
...
@@ -2350,7 +2350,7 @@ int CIFSFindSingle(const int xid, struct cifsTconInfo *tcon,
...
@@ -2350,7 +2350,7 @@ int CIFSFindSingle(const int xid, struct cifsTconInfo *tcon,
if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
name_len =
name_len =
cifsConvertToUCS((
wchar_t
*) pSMB->FileName, searchName, PATH_MAX
cifsConvertToUCS((
__le16
*) pSMB->FileName, searchName, PATH_MAX
/* find define for this maxpathcomponent */
/* find define for this maxpathcomponent */
, nls_codepage);
, nls_codepage);
name_len++; /* trailing null */
name_len++; /* trailing null */
...
@@ -2435,7 +2435,7 @@ CIFSFindFirst(const int xid, struct cifsTconInfo *tcon,
...
@@ -2435,7 +2435,7 @@ CIFSFindFirst(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
searchName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
searchName
,
PATH_MAX
,
nls_codepage
,
remap
);
PATH_MAX
,
nls_codepage
,
remap
);
/* We can not add the asterik earlier in case
/* We can not add the asterik earlier in case
it got remapped to 0xF03A as if it were part of the
it got remapped to 0xF03A as if it were part of the
...
@@ -2726,7 +2726,7 @@ CIFSGetSrvInodeNumber(const int xid, struct cifsTconInfo *tcon,
...
@@ -2726,7 +2726,7 @@ CIFSGetSrvInodeNumber(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
searchName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
searchName
,
PATH_MAX
,
nls_codepage
,
remap
);
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
++
;
/* trailing null */
name_len
*=
2
;
name_len
*=
2
;
...
@@ -2837,7 +2837,7 @@ CIFSGetDFSRefer(const int xid, struct cifsSesInfo *ses,
...
@@ -2837,7 +2837,7 @@ CIFSGetDFSRefer(const int xid, struct cifsSesInfo *ses,
if
(
ses
->
capabilities
&
CAP_UNICODE
)
{
if
(
ses
->
capabilities
&
CAP_UNICODE
)
{
pSMB
->
hdr
.
Flags2
|=
SMBFLG2_UNICODE
;
pSMB
->
hdr
.
Flags2
|=
SMBFLG2_UNICODE
;
name_len
=
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
RequestFileName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
RequestFileName
,
searchName
,
PATH_MAX
,
nls_codepage
,
remap
);
searchName
,
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
++
;
/* trailing null */
name_len
*=
2
;
name_len
*=
2
;
...
@@ -3369,7 +3369,7 @@ CIFSSMBSetEOF(const int xid, struct cifsTconInfo *tcon, const char *fileName,
...
@@ -3369,7 +3369,7 @@ CIFSSMBSetEOF(const int xid, struct cifsTconInfo *tcon, const char *fileName,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
fileName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
fileName
,
PATH_MAX
,
nls_codepage
,
remap
);
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
++
;
/* trailing null */
name_len
*=
2
;
name_len
*=
2
;
...
@@ -3627,7 +3627,7 @@ CIFSSMBSetTimes(const int xid, struct cifsTconInfo *tcon, const char *fileName,
...
@@ -3627,7 +3627,7 @@ CIFSSMBSetTimes(const int xid, struct cifsTconInfo *tcon, const char *fileName,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
fileName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
fileName
,
PATH_MAX
,
nls_codepage
,
remap
);
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
++
;
/* trailing null */
name_len
*=
2
;
name_len
*=
2
;
...
@@ -3708,7 +3708,7 @@ CIFSSMBSetAttrLegacy(int xid, struct cifsTconInfo *tcon, char *fileName,
...
@@ -3708,7 +3708,7 @@ CIFSSMBSetAttrLegacy(int xid, struct cifsTconInfo *tcon, char *fileName,
if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
name_len =
name_len =
ConvertToUCS((
wchar_t
*) pSMB->fileName, fileName,
ConvertToUCS((
__le16
*) pSMB->fileName, fileName,
PATH_MAX, nls_codepage);
PATH_MAX, nls_codepage);
name_len++; /* trailing null */
name_len++; /* trailing null */
name_len *= 2;
name_len *= 2;
...
@@ -3759,7 +3759,7 @@ CIFSSMBUnixSetPerms(const int xid, struct cifsTconInfo *tcon,
...
@@ -3759,7 +3759,7 @@ CIFSSMBUnixSetPerms(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
fileName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
fileName
,
PATH_MAX
,
nls_codepage
,
remap
);
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
++
;
/* trailing null */
name_len
*=
2
;
name_len
*=
2
;
...
@@ -3904,7 +3904,7 @@ CIFSSMBQAllEAs(const int xid, struct cifsTconInfo *tcon,
...
@@ -3904,7 +3904,7 @@ CIFSSMBQAllEAs(const int xid, struct cifsTconInfo *tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
name_len
=
cifsConvertToUCS
((
wchar_t
*
)
pSMB
->
FileName
,
searchName
,
cifsConvertToUCS
((
__le16
*
)
pSMB
->
FileName
,
searchName
,
PATH_MAX
,
nls_codepage
,
remap
);
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
++
;
/* trailing null */
name_len
*=
2
;
name_len
*=
2
;
...
@@ -4047,7 +4047,7 @@ ssize_t CIFSSMBQueryEA(const int xid,struct cifsTconInfo * tcon,
...
@@ -4047,7 +4047,7 @@ ssize_t CIFSSMBQueryEA(const int xid,struct cifsTconInfo * tcon,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
searchName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
searchName
,
PATH_MAX
,
nls_codepage
,
remap
);
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
++
;
/* trailing null */
name_len
*=
2
;
name_len
*=
2
;
...
@@ -4194,7 +4194,7 @@ CIFSSMBSetEA(const int xid, struct cifsTconInfo *tcon, const char *fileName,
...
@@ -4194,7 +4194,7 @@ CIFSSMBSetEA(const int xid, struct cifsTconInfo *tcon, const char *fileName,
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
if
(
pSMB
->
hdr
.
Flags2
&
SMBFLG2_UNICODE
)
{
name_len
=
name_len
=
cifsConvertToUCS
((
__
u
16
*
)
pSMB
->
FileName
,
fileName
,
cifsConvertToUCS
((
__
le
16
*
)
pSMB
->
FileName
,
fileName
,
PATH_MAX
,
nls_codepage
,
remap
);
PATH_MAX
,
nls_codepage
,
remap
);
name_len
++
;
/* trailing null */
name_len
++
;
/* trailing null */
name_len
*=
2
;
name_len
*=
2
;
...
...
fs/cifs/dir.c
View file @
16a789c1
...
@@ -392,7 +392,8 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, struct name
...
@@ -392,7 +392,8 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, struct name
rc
=
0
;
rc
=
0
;
d_add
(
direntry
,
NULL
);
d_add
(
direntry
,
NULL
);
}
else
{
}
else
{
cERROR
(
1
,(
"Error 0x%x or on cifs_get_inode_info in lookup"
,
rc
));
cERROR
(
1
,(
"Error 0x%x on cifs_get_inode_info in lookup of %s"
,
rc
,
full_path
));
/* BB special case check for Access Denied - watch security
/* BB special case check for Access Denied - watch security
exposure of returning dir info implicitly via different rc
exposure of returning dir info implicitly via different rc
if file exists or not but no access BB */
if file exists or not but no access BB */
...
...
fs/cifs/inode.c
View file @
16a789c1
...
@@ -422,6 +422,7 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry)
...
@@ -422,6 +422,7 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry)
cifs_sb
->
mnt_cifs_flags
&
CIFS_MOUNT_MAP_SPECIAL_CHR
);
cifs_sb
->
mnt_cifs_flags
&
CIFS_MOUNT_MAP_SPECIAL_CHR
);
if
(
!
rc
)
{
if
(
!
rc
)
{
if
(
direntry
->
d_inode
)
direntry
->
d_inode
->
i_nlink
--
;
direntry
->
d_inode
->
i_nlink
--
;
}
else
if
(
rc
==
-
ENOENT
)
{
}
else
if
(
rc
==
-
ENOENT
)
{
d_drop
(
direntry
);
d_drop
(
direntry
);
...
@@ -440,6 +441,7 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry)
...
@@ -440,6 +441,7 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry)
cifs_sb
->
mnt_cifs_flags
&
cifs_sb
->
mnt_cifs_flags
&
CIFS_MOUNT_MAP_SPECIAL_CHR
);
CIFS_MOUNT_MAP_SPECIAL_CHR
);
CIFSSMBClose
(
xid
,
pTcon
,
netfid
);
CIFSSMBClose
(
xid
,
pTcon
,
netfid
);
if
(
direntry
->
d_inode
)
direntry
->
d_inode
->
i_nlink
--
;
direntry
->
d_inode
->
i_nlink
--
;
}
}
}
else
if
(
rc
==
-
EACCES
)
{
}
else
if
(
rc
==
-
EACCES
)
{
...
@@ -494,6 +496,7 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry)
...
@@ -494,6 +496,7 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry)
cifs_sb
->
mnt_cifs_flags
&
cifs_sb
->
mnt_cifs_flags
&
CIFS_MOUNT_MAP_SPECIAL_CHR
);
CIFS_MOUNT_MAP_SPECIAL_CHR
);
if
(
!
rc
)
{
if
(
!
rc
)
{
if
(
direntry
->
d_inode
)
direntry
->
d_inode
->
i_nlink
--
;
direntry
->
d_inode
->
i_nlink
--
;
}
else
if
(
rc
==
-
ETXTBSY
)
{
}
else
if
(
rc
==
-
ETXTBSY
)
{
int
oplock
=
FALSE
;
int
oplock
=
FALSE
;
...
@@ -514,17 +517,20 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry)
...
@@ -514,17 +517,20 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry)
cifs_sb
->
mnt_cifs_flags
&
cifs_sb
->
mnt_cifs_flags
&
CIFS_MOUNT_MAP_SPECIAL_CHR
);
CIFS_MOUNT_MAP_SPECIAL_CHR
);
CIFSSMBClose
(
xid
,
pTcon
,
netfid
);
CIFSSMBClose
(
xid
,
pTcon
,
netfid
);
if
(
direntry
->
d_inode
)
direntry
->
d_inode
->
i_nlink
--
;
direntry
->
d_inode
->
i_nlink
--
;
}
}
/* BB if rc = -ETXTBUSY goto the rename logic BB */
/* BB if rc = -ETXTBUSY goto the rename logic BB */
}
}
}
}
}
}
if
(
direntry
->
d_inode
)
{
cifsInode
=
CIFS_I
(
direntry
->
d_inode
);
cifsInode
=
CIFS_I
(
direntry
->
d_inode
);
cifsInode
->
time
=
0
;
/* will force revalidate to get info when
cifsInode
->
time
=
0
;
/* will force revalidate to get info
needed */
when needed */
direntry
->
d_inode
->
i_ctime
=
inode
->
i_ctime
=
inode
->
i_mtime
=
direntry
->
d_inode
->
i_ctime
=
current_fs_time
(
inode
->
i_sb
);
current_fs_time
(
inode
->
i_sb
);
}
inode
->
i_ctime
=
inode
->
i_mtime
=
current_fs_time
(
inode
->
i_sb
);
cifsInode
=
CIFS_I
(
inode
);
cifsInode
=
CIFS_I
(
inode
);
cifsInode
->
time
=
0
;
/* force revalidate of dir as well */
cifsInode
->
time
=
0
;
/* force revalidate of dir as well */
...
...
fs/cifs/misc.c
View file @
16a789c1
...
@@ -571,6 +571,7 @@ cifs_convertUCSpath(char *target, const __le16 * source, int maxlen,
...
@@ -571,6 +571,7 @@ cifs_convertUCSpath(char *target, const __le16 * source, int maxlen,
break
;
break
;
case
UNI_LESSTHAN
:
case
UNI_LESSTHAN
:
target
[
j
]
=
'<'
;
target
[
j
]
=
'<'
;
break
;
default:
default:
len
=
cp
->
uni2char
(
src_char
,
&
target
[
j
],
len
=
cp
->
uni2char
(
src_char
,
&
target
[
j
],
NLS_MAX_CHARSET_SIZE
);
NLS_MAX_CHARSET_SIZE
);
...
...
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