* Problem with CIFS
@ 2004-08-17 10:08 Daniel Paschka
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Paschka @ 2004-08-17 10:08 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 972 bytes --]
I was trying to use CIFS, but it failed to mount my samba shares whereas
mounting a share of a Win2K PC worked.
I dowloaded and compiled the newest samba-server, but that didn't help
either so I investigated a bit.
After googling if someone else was experiencing this problem I became a
bit iritated because I only found a handful results, none helped to
solve this problem in any way.
So I narrowed the problem down myself.
In fs/cifs/cifssmb.c around line 238 the cifs modul expects a 16 Byte
GUID, where samba only send 14 bytes consisting of some random numbers
followed by my workgroupname: WG.
So I to set my workgroupname to something longer with enabled me to
mount my share.
I am not sure what the right behaviour is (must cifs accept shorter
seqenzes or must samba send some dummy bytes to fill up to 16 Bytes),
but I think it should be possible to mount shares in workgroups which
names are shorter the 4 Bytes.
Help would be appreciated
Daniel
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Problem with CIFS
@ 2004-08-19 2:36 Steve French
2004-08-19 20:28 ` Jeremy Allison
0 siblings, 1 reply; 4+ messages in thread
From: Steve French @ 2004-08-19 2:36 UTC (permalink / raw)
To: jra, samba-technical, linux-cifs-client, linux-kernel
>Can you show me where the problem is ?
>Currently in smbd/negprot.c we have :
>
> /* do spnego in user level security if the client
> supports it and we can do encrypted passwords*/
>
> if (global_encrypted_passwords_negotiated &&
> (lp_security() != SEC_SHARE) &&
> lp_use_spnego() &&
> (SVAL(inbuf, smb_flg2) & FLAGS2_EXTENDED_SECURITY)) {
> negotiate_spnego = True;
> capabilities |= CAP_EXTENDED_SECURITY;
> }
I think Samba is just missing the else clause in smbd/negprot.c(since
reply_common sets FLAGS2_EXTENDED_SECURITY otherwise). Something like:
else {
remove_from_common_flags2(FLAGS2_EXTENDED_SECURITY);
SSVAL(outbuf,smb_flg2,(SVAL(outbuf,smb_flg2) &
(~FLAGS2_EXTENDED_SECURITY)));
}
but in any case I have to workaround it in the Linux cifs client by
paying more attention to the capability bit than to the actual smb flag
^ permalink raw reply [flat|nested] 4+ messages in thread
* re: Problem with CIFS
[not found] <20040818120033.9DD101638C1@lists.samba.org>
@ 2004-08-19 10:09 ` Steve French (IBM LTC)
0 siblings, 0 replies; 4+ messages in thread
From: Steve French (IBM LTC) @ 2004-08-19 10:09 UTC (permalink / raw)
To: linux-cifs-client, Andrew Morton, linux-kernel
> I was trying to use CIFS, but it failed to mount my samba shares
> whereas mounting a share of a Win2K PC worked. <snip>
> In fs/cifs/cifssmb.c around line 238 the cifs modul expects a 16 Byte
> GUID, where samba only send 14 bytes consisting of some random
> numbers followed by my workgroupname: WG.
> So I to set my workgroupname to something longer with enabled me to
> mount my share.
This is caused by an interesting bug in Samba, but one I should be able to
workaround. Basically Samba is setting a flag in the negotiate response saying
"I support extended security"
which indicates that this frame should be decoded as if it contained an SPNEGO blob
(ala RFC 2478) and a conflicting capability in the same frame which indicates
"I am not capable of extended security"
The Samba server sets this SMB_FLAGS2_EXTENDED_SECURITY in the response even though
the client said - no extended security (Windows gets this right). Presumably all
other smb/cifs clients either 1) negotiate extended security (this is turned off by
default in the cifs vfs ie /proc/fs/cifs/ExtendedSecurity is zero) or 2) don't
check or don't care what is in the bcc area of the negprot response (which is the
case for earlier clients)
> but I think it should be possible to mount shares in workgroups which
> names are shorter the 4 Bytes.
Yes you are correct - there is no minimum domain length, although there is a minimal
bcc length for true NTLMSSP and SPNEGO negotiate responses which I will now be
forced to detect differently on the client. As you noticed it worked for longer
domain names, because the bcc was larger and spnego decoding was harmless for longer
domain names.
I will fix this today, probably by adding a check in fs/cifs/cifssmb.c (in
CIFSSMBNegotiate) in parsing the negotiate response from something like from:
if (pSMBr->hdr.Flags2 & SMBFLG2_EXT_SEC)
to
if ((pSMBr->hdr.Flags2 & SMBFLG2_EXT_SEC) &&
(server->capabilities & CAP_EXTENDED_SECURITY))
The Samba fix is pretty easy as well (it only hits source/smbd/negprot.c -
reply_negprot function), I will bounce the fix off jra before updating the Samba 3
source.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Problem with CIFS
2004-08-19 2:36 Steve French
@ 2004-08-19 20:28 ` Jeremy Allison
0 siblings, 0 replies; 4+ messages in thread
From: Jeremy Allison @ 2004-08-19 20:28 UTC (permalink / raw)
To: Steve French; +Cc: jra, samba-technical, linux-cifs-client, linux-kernel
On Wed, Aug 18, 2004 at 09:36:21PM -0500, Steve French wrote:
> >Can you show me where the problem is ?
> >Currently in smbd/negprot.c we have :
> >
> > /* do spnego in user level security if the client
> > supports it and we can do encrypted passwords*/
> >
> > if (global_encrypted_passwords_negotiated &&
> > (lp_security() != SEC_SHARE) &&
> > lp_use_spnego() &&
> > (SVAL(inbuf, smb_flg2) & FLAGS2_EXTENDED_SECURITY)) {
> > negotiate_spnego = True;
> > capabilities |= CAP_EXTENDED_SECURITY;
> > }
>
> I think Samba is just missing the else clause in smbd/negprot.c(since
> reply_common sets FLAGS2_EXTENDED_SECURITY otherwise). Something like:
>
> else {
> remove_from_common_flags2(FLAGS2_EXTENDED_SECURITY);
> SSVAL(outbuf,smb_flg2,(SVAL(outbuf,smb_flg2) &
> (~FLAGS2_EXTENDED_SECURITY)));
> }
>
> but in any case I have to workaround it in the Linux cifs client by
> paying more attention to the capability bit than to the actual smb flag
FYI: I just fixed this in the 3.x SVN tree. It won't be in 3.0.6
but should be in 3.0.7 and above. Thanks !
Jeremy.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-08-19 20:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-17 10:08 Problem with CIFS Daniel Paschka
-- strict thread matches above, loose matches on Subject: below --
2004-08-19 2:36 Steve French
2004-08-19 20:28 ` Jeremy Allison
[not found] <20040818120033.9DD101638C1@lists.samba.org>
2004-08-19 10:09 ` Steve French (IBM LTC)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox