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
Kirill Smelkov
linux
Commits
82edf0ac
Commit
82edf0ac
authored
Oct 11, 2002
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://cifs.bkbits.net/linux-2.5-with-cifs
into home.transmeta.com:/home/torvalds/v2.5/linux
parents
54165329
9ab64854
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
85 additions
and
102 deletions
+85
-102
fs/cifs/asn1.c
fs/cifs/asn1.c
+1
-1
fs/cifs/cifs_debug.c
fs/cifs/cifs_debug.c
+1
-1
fs/cifs/cifs_debug.h
fs/cifs/cifs_debug.h
+1
-1
fs/cifs/cifssmb.c
fs/cifs/cifssmb.c
+53
-57
fs/cifs/connect.c
fs/cifs/connect.c
+26
-29
fs/cifs/file.c
fs/cifs/file.c
+0
-7
fs/cifs/inode.c
fs/cifs/inode.c
+0
-3
fs/cifs/nterr.c
fs/cifs/nterr.c
+3
-3
No files found.
fs/cifs/asn1.c
View file @
82edf0ac
...
...
@@ -458,7 +458,7 @@ decode_negTokenInit(unsigned char *security_blob, int length,
unsigned
int
cls
,
con
,
tag
,
oidlen
,
rc
;
int
use_ntlmssp
=
FALSE
;
dump_mem
(
" Received SecBlob "
,
security_blob
,
length
);
/* cifs_dump_mem(" Received SecBlob ", security_blob, length); */
asn1_open
(
&
ctx
,
security_blob
,
length
);
...
...
fs/cifs/cifs_debug.c
View file @
82edf0ac
...
...
@@ -32,7 +32,7 @@
#include "cifs_debug.h"
void
dump_mem
(
char
*
label
,
void
*
data
,
int
length
)
cifs_
dump_mem
(
char
*
label
,
void
*
data
,
int
length
)
{
int
i
,
j
;
int
*
intptr
=
data
;
...
...
fs/cifs/cifs_debug.h
View file @
82edf0ac
...
...
@@ -23,7 +23,7 @@
#ifndef _H_CIFS_DEBUG
#define _H_CIFS_DEBUG
void
dump_mem
(
char
*
label
,
void
*
data
,
int
length
);
void
cifs_
dump_mem
(
char
*
label
,
void
*
data
,
int
length
);
extern
int
traceSMB
;
/* flag which enables the function below */
void
dump_smb
(
struct
smb_hdr
*
,
int
);
...
...
fs/cifs/cifssmb.c
View file @
82edf0ac
This diff is collapsed.
Click to expand it.
fs/cifs/connect.c
View file @
82edf0ac
...
...
@@ -168,7 +168,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
}
else
if
(
temp
[
0
]
!=
(
char
)
0
)
{
cERROR
(
1
,
(
"
\n
Unknown RFC 1001 frame received not 0x00 nor 0x85"
));
dump_mem
(
" Received Data is: "
,
temp
,
length
);
cifs_
dump_mem
(
" Received Data is: "
,
temp
,
length
);
break
;
}
else
{
if
((
length
!=
sizeof
(
struct
smb_hdr
)
-
1
)
...
...
@@ -757,8 +757,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
/* Removed following few lines to not send old style password
hash ever - for better security */
/* toUpper(cifs_sb->local_nls, password_with_pad);
SMBencrypt(password_with_pad, cryptKey,session_key);
dump_mem("\nCIFS (Samba encrypt): ", session_key,CIFS_SESSION_KEY_SIZE); */
SMBencrypt(password_with_pad, cryptKey,session_key); */
rc
=
CIFSSessSetup
(
xid
,
pSesInfo
,
volume_info
.
username
,
...
...
@@ -925,7 +924,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, char *user,
bcc_ptr
+=
CIFS_SESSION_KEY_SIZE
;
if
(
ses
->
capabilities
&
CAP_UNICODE
)
{
if
((
int
)
bcc_ptr
%
2
)
{
/* must be word aligned for Unicode */
if
((
long
)
bcc_ptr
%
2
)
{
/* must be word aligned for Unicode */
*
bcc_ptr
=
0
;
bcc_ptr
++
;
}
...
...
@@ -983,13 +982,12 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, char *user,
strcpy
(
bcc_ptr
,
CIFS_NETWORK_OPSYS
);
bcc_ptr
+=
strlen
(
CIFS_NETWORK_OPSYS
)
+
1
;
}
BCC
(
smb_buffer
)
=
(
int
)
bcc_ptr
-
(
int
)
pByteArea
(
smb_buffer
);
BCC
(
smb_buffer
)
=
(
long
)
bcc_ptr
-
(
long
)
pByteArea
(
smb_buffer
);
smb_buffer
->
smb_buf_length
+=
BCC
(
smb_buffer
);
BCC
(
smb_buffer
)
=
cpu_to_le16
(
BCC
(
smb_buffer
));
rc
=
SendReceive
(
xid
,
ses
,
smb_buffer
,
smb_buffer_response
,
&
bytes_returned
,
1
);
/* dump_mem("\nSessSetup response is: ", smb_buffer_response, 92);*/
if
(
rc
)
{
/* rc = map_smb_to_linux_error(smb_buffer_response); now done in SendReceive */
}
else
if
((
smb_buffer_response
->
WordCount
==
3
)
...
...
@@ -1011,7 +1009,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, char *user,
pSMBr
->
resp
.
SecurityBlobLength
;
if
(
smb_buffer
->
Flags2
&=
SMBFLG2_UNICODE
)
{
if
((
int
)
(
bcc_ptr
)
%
2
)
{
if
((
long
)
(
bcc_ptr
)
%
2
)
{
remaining_words
=
(
BCC
(
smb_buffer_response
)
-
1
)
/
2
;
...
...
@@ -1069,7 +1067,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, char *user,
}
else
{
/* ASCII */
len
=
strnlen
(
bcc_ptr
,
1024
);
if
(((
int
)
bcc_ptr
+
len
)
-
(
int
)
if
(((
long
)
bcc_ptr
+
len
)
-
(
long
)
pByteArea
(
smb_buffer_response
)
<=
BCC
(
smb_buffer_response
))
{
ses
->
serverOS
=
kcalloc
(
len
+
1
,
GFP_KERNEL
);
...
...
@@ -1176,7 +1174,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
bcc_ptr
+=
SecurityBlobLength
;
if
(
ses
->
capabilities
&
CAP_UNICODE
)
{
if
((
int
)
bcc_ptr
%
2
)
{
/* must be word aligned for Unicode strings */
if
((
long
)
bcc_ptr
%
2
)
{
/* must be word aligned for Unicode strings */
*
bcc_ptr
=
0
;
bcc_ptr
++
;
}
...
...
@@ -1229,13 +1227,12 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
strcpy
(
bcc_ptr
,
CIFS_NETWORK_OPSYS
);
bcc_ptr
+=
strlen
(
CIFS_NETWORK_OPSYS
)
+
1
;
}
BCC
(
smb_buffer
)
=
(
int
)
bcc_ptr
-
(
int
)
pByteArea
(
smb_buffer
);
BCC
(
smb_buffer
)
=
(
long
)
bcc_ptr
-
(
long
)
pByteArea
(
smb_buffer
);
smb_buffer
->
smb_buf_length
+=
BCC
(
smb_buffer
);
BCC
(
smb_buffer
)
=
cpu_to_le16
(
BCC
(
smb_buffer
));
rc
=
SendReceive
(
xid
,
ses
,
smb_buffer
,
smb_buffer_response
,
&
bytes_returned
,
1
);
/* dump_mem("\nSessSetup response is: ", smb_buffer_response, 92); */
if
(
rc
)
{
/* rc = map_smb_to_linux_error(smb_buffer_response); *//* done in SendReceive now */
}
else
if
((
smb_buffer_response
->
WordCount
==
3
)
...
...
@@ -1265,7 +1262,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
}
if
(
smb_buffer
->
Flags2
&=
SMBFLG2_UNICODE
)
{
if
((
int
)
(
bcc_ptr
)
%
2
)
{
if
((
long
)
(
bcc_ptr
)
%
2
)
{
remaining_words
=
(
BCC
(
smb_buffer_response
)
-
1
)
/
2
;
...
...
@@ -1328,7 +1325,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
}
else
{
/* ASCII */
len
=
strnlen
(
bcc_ptr
,
1024
);
if
(((
int
)
bcc_ptr
+
len
)
-
(
int
)
if
(((
long
)
bcc_ptr
+
len
)
-
(
long
)
pByteArea
(
smb_buffer_response
)
<=
BCC
(
smb_buffer_response
))
{
ses
->
serverOS
=
kcalloc
(
len
+
1
,
GFP_KERNEL
);
...
...
@@ -1465,16 +1462,16 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
SecurityBlob
->
DomainName
.
MaximumLength
=
cpu_to_le16
(
SecurityBlob
->
DomainName
.
Length
);
SecurityBlob
->
DomainName
.
Buffer
=
cpu_to_le32
((
unsigned
int
)
&
SecurityBlob
->
cpu_to_le32
((
long
)
&
SecurityBlob
->
DomainString
-
(
unsigned
int
)
&
SecurityBlob
->
Signature
);
(
long
)
&
SecurityBlob
->
Signature
);
bcc_ptr
+=
SecurityBlob
->
DomainName
.
Length
;
SecurityBlobLength
+=
SecurityBlob
->
DomainName
.
Length
;
SecurityBlob
->
DomainName
.
Length
=
cpu_to_le16
(
SecurityBlob
->
DomainName
.
Length
);
}
if
(
ses
->
capabilities
&
CAP_UNICODE
)
{
if
((
int
)
bcc_ptr
%
2
)
{
if
((
long
)
bcc_ptr
%
2
)
{
*
bcc_ptr
=
0
;
bcc_ptr
++
;
}
...
...
@@ -1511,7 +1508,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
SecurityBlob
->
NegotiateFlags
=
cpu_to_le32
(
SecurityBlob
->
NegotiateFlags
);
pSMB
->
req
.
SecurityBlobLength
=
cpu_to_le16
(
SecurityBlobLength
);
BCC
(
smb_buffer
)
=
(
int
)
bcc_ptr
-
(
int
)
pByteArea
(
smb_buffer
);
BCC
(
smb_buffer
)
=
(
long
)
bcc_ptr
-
(
long
)
pByteArea
(
smb_buffer
);
smb_buffer
->
smb_buf_length
+=
BCC
(
smb_buffer
);
BCC
(
smb_buffer
)
=
cpu_to_le16
(
BCC
(
smb_buffer
));
...
...
@@ -1564,7 +1561,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
if
(
SecurityBlob2
->
NegotiateFlags
&
NTLMSSP_NEGOTIATE_NTLMV2
)
*
pNTLMv2_flag
=
TRUE
;
if
(
smb_buffer
->
Flags2
&=
SMBFLG2_UNICODE
)
{
if
((
int
)
(
bcc_ptr
)
%
2
)
{
if
((
long
)
(
bcc_ptr
)
%
2
)
{
remaining_words
=
(
BCC
(
smb_buffer_response
)
-
1
)
/
2
;
...
...
@@ -1650,7 +1647,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
}
else
{
/* ASCII */
len
=
strnlen
(
bcc_ptr
,
1024
);
if
(((
int
)
bcc_ptr
+
len
)
-
(
int
)
if
(((
long
)
bcc_ptr
+
len
)
-
(
long
)
pByteArea
(
smb_buffer_response
)
<=
BCC
(
smb_buffer_response
))
{
ses
->
serverOS
=
...
...
@@ -1846,7 +1843,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
SecurityBlobLength += SecurityBlob->WorkstationName.Length;
SecurityBlob->WorkstationName.Length = cpu_to_le16(SecurityBlob->WorkstationName.Length); */
if
((
int
)
bcc_ptr
%
2
)
{
if
((
long
)
bcc_ptr
%
2
)
{
*
bcc_ptr
=
0
;
bcc_ptr
++
;
}
...
...
@@ -1918,7 +1915,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
SecurityBlob
->
NegotiateFlags
=
cpu_to_le32
(
SecurityBlob
->
NegotiateFlags
);
pSMB
->
req
.
SecurityBlobLength
=
cpu_to_le16
(
SecurityBlobLength
);
BCC
(
smb_buffer
)
=
(
int
)
bcc_ptr
-
(
int
)
pByteArea
(
smb_buffer
);
BCC
(
smb_buffer
)
=
(
long
)
bcc_ptr
-
(
long
)
pByteArea
(
smb_buffer
);
smb_buffer
->
smb_buf_length
+=
BCC
(
smb_buffer
);
BCC
(
smb_buffer
)
=
cpu_to_le16
(
BCC
(
smb_buffer
));
...
...
@@ -1959,7 +1956,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
(
"
\n
NTLMSSP response to Authenticate "
));
if
(
smb_buffer
->
Flags2
&=
SMBFLG2_UNICODE
)
{
if
((
int
)
(
bcc_ptr
)
%
2
)
{
if
((
long
)
(
bcc_ptr
)
%
2
)
{
remaining_words
=
(
BCC
(
smb_buffer_response
)
-
1
)
/
2
;
...
...
@@ -2037,8 +2034,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
}
else
{
/* ASCII */
len
=
strnlen
(
bcc_ptr
,
1024
);
if
(((
int
)
bcc_ptr
+
len
)
-
(
int
)
pByteArea
(
smb_buffer_response
)
if
(((
long
)
bcc_ptr
+
len
)
-
(
long
)
pByteArea
(
smb_buffer_response
)
<=
BCC
(
smb_buffer_response
))
{
ses
->
serverOS
=
kcalloc
(
len
+
1
,
GFP_KERNEL
);
strncpy
(
ses
->
serverOS
,
bcc_ptr
,
len
);
...
...
@@ -2142,7 +2139,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
strcpy
(
bcc_ptr
,
"?????"
);
bcc_ptr
+=
strlen
(
"?????"
);
bcc_ptr
+=
1
;
BCC
(
smb_buffer
)
=
(
int
)
bcc_ptr
-
(
int
)
pByteArea
(
smb_buffer
);
BCC
(
smb_buffer
)
=
(
long
)
bcc_ptr
-
(
long
)
pByteArea
(
smb_buffer
);
smb_buffer
->
smb_buf_length
+=
BCC
(
smb_buffer
);
BCC
(
smb_buffer
)
=
cpu_to_le16
(
BCC
(
smb_buffer
));
...
...
@@ -2159,8 +2156,8 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
strncpy
(
tcon
->
treeName
,
tree
,
MAX_TREE_SIZE
);
if
(
smb_buffer
->
Flags2
&=
SMBFLG2_UNICODE
)
{
length
=
UniStrnlen
((
wchar_t
*
)
bcc_ptr
,
512
);
if
(((
int
)
bcc_ptr
+
(
2
*
length
))
-
(
int
)
pByteArea
(
smb_buffer_response
)
<=
if
(((
long
)
bcc_ptr
+
(
2
*
length
))
-
(
long
)
pByteArea
(
smb_buffer_response
)
<=
BCC
(
smb_buffer_response
))
{
tcon
->
nativeFileSystem
=
kcalloc
(
length
+
2
,
GFP_KERNEL
);
...
...
@@ -2175,8 +2172,8 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
/* else do not bother copying these informational fields */
}
else
{
length
=
strnlen
(
bcc_ptr
,
1024
);
if
(((
int
)
bcc_ptr
+
length
)
-
(
int
)
pByteArea
(
smb_buffer_response
)
<=
if
(((
long
)
bcc_ptr
+
length
)
-
(
long
)
pByteArea
(
smb_buffer_response
)
<=
BCC
(
smb_buffer_response
))
{
tcon
->
nativeFileSystem
=
kcalloc
(
length
+
1
,
GFP_KERNEL
);
...
...
fs/cifs/file.c
View file @
82edf0ac
...
...
@@ -572,9 +572,6 @@ fill_in_inode(struct inode *tmp_inode,
tmp_inode
->
i_size
=
pfindData
->
EndOfFile
;
tmp_inode
->
i_blocks
=
do_div
(
pfindData
->
AllocationSize
,
tmp_inode
->
i_blksize
);
cFYI
(
1
,
(
"
\n
Finddata alloc size (from smb) %lld"
,
pfindData
->
AllocationSize
));
if
(
pfindData
->
AllocationSize
<
pfindData
->
EndOfFile
)
cFYI
(
1
,
(
"
\n
Server inconsistency Error: it says allocation size less than end of file "
));
cFYI
(
1
,
...
...
@@ -652,10 +649,6 @@ unix_fill_in_inode(struct inode *tmp_inode,
tmp_inode
->
i_size
=
pfindData
->
EndOfFile
;
tmp_inode
->
i_blocks
=
do_div
(
pfindData
->
NumOfBytes
,
tmp_inode
->
i_blksize
);
cFYI
(
0
,
(
"
\n
Finddata alloc size (from smb) %lld"
,
pfindData
->
NumOfBytes
));
/* BB remove */
if
(
pfindData
->
NumOfBytes
<
pfindData
->
EndOfFile
)
cFYI
(
0
,
(
"
\n
Server inconsistency Error: it says allocation size less than end of file "
));
/* BB remove */
cFYI
(
1
,
(
"
\n
CIFS FFIRST: Size %ld and blocks %ld "
,
(
unsigned
long
)
tmp_inode
->
i_size
,
tmp_inode
->
i_blocks
));
/* BB remove */
if
(
S_ISREG
(
tmp_inode
->
i_mode
))
{
cFYI
(
1
,
(
" File inode "
));
tmp_inode
->
i_op
=
&
cifs_file_inode_ops
;
...
...
fs/cifs/inode.c
View file @
82edf0ac
...
...
@@ -131,9 +131,6 @@ cifs_get_inode_info_unix(struct inode **pinode,
inode
->
i_blksize
=
(
pTcon
->
ses
->
maxBuf
-
MAX_CIFS_HDR_SIZE
)
&
0xFFFFFE00
;
inode
->
i_blocks
=
do_div
(
findData
.
NumOfBytes
,
inode
->
i_blksize
);
cFYI
(
1
,
(
"
\n
Finddata alloc size (from smb) %lld"
,
findData
.
NumOfBytes
));
if
(
findData
.
NumOfBytes
<
findData
.
EndOfFile
)
cFYI
(
1
,
(
"
\n
Server inconsistency Error: it says allocation size less than end of file "
));
cFYI
(
1
,
...
...
fs/cifs/nterr.c
View file @
82edf0ac
...
...
@@ -694,8 +694,8 @@ const struct nt_err_code_struct nt_errs[] = {
/*****************************************************************************
Print an error message from the status code
*****************************************************************************/
void
print_status
(
__u32
status_code
)
/*
void
cifs_
print_status(__u32 status_code)
{
int idx = 0;
...
...
@@ -709,4 +709,4 @@ print_status(__u32 status_code)
idx++;
}
return;
}
}
*/
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