Bug 4039 - -o guest doesn't do anonymous session setup
Summary: -o guest doesn't do anonymous session setup
Status: RESOLVED DUPLICATE of bug 4640
Alias: None
Product: CifsVFS
Classification: Unclassified
Component: kernel fs (show other bugs)
Version: 2.6
Hardware: Other Linux
: P3 normal
Target Milestone: ---
Assignee: Steve French
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-21 07:42 UTC by Pierre Ossman
Modified: 2009-05-15 10:51 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Ossman 2006-08-21 07:42:34 UTC
When debugging with smbclient I had no problem browsing around a share and doing my stuff without having a valid account on the machine. When I later tried mounting it I could not get around gettint a "-13 Access denied".

After some analysing with wireshark I figured out the difference. smbclient will fall back to setting up an anonymous session when the auth fails. With mount.cifs, all I can do is supress the password prompt.

(The server being tested here was Samba itself).
Comment 1 Jan Engelhardt 2006-10-16 07:06:15 UTC
Same problem here. 2.6.18:

14:04 ichi:~ # mount -t smbfs //ichi/terran /mnt/0 -o guest
Anonymous login successful
14:04 ichi:~ # umount /mnt/0
14:04 ichi:~ # mount -t cifs //ichi/terran /mnt/0 -o guest
mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
14:04 ichi:~ # smbclient //ichi/terran
Password: <empty>
Anonymous login successful
Domain=[NONE] OS=[Unix] Server=[Samba 3.0.22-jen]
smb: \> 
Comment 2 Steve French 2006-11-02 11:35:21 UTC
The kernel portion of this is fixed in the kernel cifs.ko module in cifs-2.6.git tree.

Note that the parameter "guest" means "do not prompt for password" not "user a null user" (anonymous).   The intent of the parm "sec=none" was to use a null user.
Comment 3 Pierre Ossman 2006-11-02 11:53:42 UTC
So if -o guest is not the same in cifs as in smbfs, what has been fixed? And why keep around a flag that has changed semantics rather severely?
Comment 4 Dax Kelson 2007-02-09 02:02:25 UTC
This problem is still causing me trouble.

uname -r
2.6.19-1.2895.fc6  (FC6's current kernel which is based on 2.6.19.2)

# mount -t cifs //station11.class2/tmp /mnt -o guest,sec=none
mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

while

# mount -t smbfs //station11.class2/tmp /mnt/tmp
Password: 
Anonymous login successful

Is it correct that the problem resided purely in kernel cifs module and that Linux merged the fix on Feb 7th 2007?
Comment 5 Dax Kelson 2007-02-09 02:06:21 UTC
Looking closer it appears the fix went in on Nov 3rd, 2006.
Comment 6 Jan Engelhardt 2007-02-09 02:10:14 UTC
See thread http://lists.samba.org/archive/linux-cifs-client/2007-February/001729.html for solution.
Comment 7 Dax Kelson 2007-02-09 02:31:19 UTC
(In reply to comment #6)
> See thread
> http://lists.samba.org/archive/linux-cifs-client/2007-February/001729.html for
> solution.
> 

That is a solution to a different problem involving a mismatch between the NetBIOS name the server expects and what the client sends.
Comment 8 Dax Kelson 2007-02-09 14:32:46 UTC
(In reply to comment #5)
> Looking closer it appears the fix went in on Nov 3rd, 2006.
> 

Well, I tried with a kernel 2.6.20 (released Feb 4th), and still no luck.

# uname -r
2.6.20
# mount -t cifs //station11/tmp /mnt/tmp -o guest,sec=none
mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
# 
Comment 9 shirishpargaonkar@gmail.com 2007-04-03 11:34:55 UTC
This works 
 mount -t cifs //192.168.1.149/cifsdir /cifsdir/ssp -o guest,sec=none
but this does not
 mount -t cifs //192.168.1.149/cifsdir /cifsdir/ssp -o guest
with 1.48 of cifs client on 2.6.20-rc6-default kernel on SLES10 and 
another SLES9 machine running samba server 3.0.24.
Comment 10 Jeff Layton 2008-12-06 06:27:42 UTC
The problem, I think, is that "guest" just tells the userspace mount helper not to prompt for a password. It should be fairly easy to make "guest" also specify "sec=none" if no other "sec=" option is specified.
Comment 11 shirishpargaonkar@gmail.com 2009-03-18 09:03:06 UTC
The fix for this is in latest samba git tree.
Comment 12 Steve French 2009-05-15 10:51:47 UTC

*** This bug has been marked as a duplicate of bug 4640 ***