cifs doesn't support connecting as guest

Bug #98658 reported by jablko
30
This bug affects 3 people
Affects Status Importance Assigned to Milestone
samba
Fix Released
Unknown
samba (Ubuntu)
Fix Released
Undecided
Chuck Short

Bug Description

Binary package hint: samba

I'm using a stock Edgy installation. I simply enabled Samba using the GUI tools and tried connecting from another Linux machine. The mount.cifs manpage describes a "guest" option, but connecting with this option doesn't work:

ket% sudo mount.cifs //mog.local/share /mnt -o guest
mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
ket%

However this option does work with mount.smb vs. mount.cifs:

ket% sudo mount.smb //mog.local/share /mnt -o guest
Anonymous login successful
ket%

As a workaround, I created a user "anonymous" with blank password:

ket% sudo mount.cifs //mog.local/share /mnt -o user=anonymous,password=
ket% ls /mnt
Movies MythVideo
ket%

However this is not a perfect solution: The autofs package's /etc/auto.smb script uses cifs by default and I don't want to have to create a credfile for "anonymous" with blank password, I want autofs to work with my Ubuntu Samba server out of the box.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=416515

Why doesn't connecting to Ubuntu with cifs and the guest option work like connecting to Ubuntu with smb and the guest option?

What needs to change so:

ket% sudo mount.cifs //mog.local/share /mnt

- or -

ket% sudo mount.cifs //mog.local/share /mnt -o guest

successfully connect, thereby enabling autofs to work out of the box?

Thanks for maintaining Samba in Ubuntu! Jack

Revision history for this message
Chuck Short (zulcss) wrote :

Hello,

Does the work around mention in the debian bug report work for you?

Thanks
chuck

Changed in samba:
assignee: nobody → zulcss
Chuck Short (zulcss)
Changed in samba:
status: New → Incomplete
Revision history for this message
jablko (ms419) wrote :

Thanks Chuck, I followed up on the Debian bug with automount. sec=none does enable mount.cifs to connect without username or password, but now results in automount kernel panics. Incidentally I experience the same kernel panics with Ubuntu automount. Will continue to work on the automount issues, unless you have input on how to proceed?

Thanks and best wishes, Jack

Changed in samba:
status: Unknown → New
Revision history for this message
Chuck Short (zulcss) wrote :

Hi,

If possible can you test this with the hardy live cd. Also it would be nice if you can attach your kernel oops that you get.

Thanks
chuck

Changed in samba:
status: Incomplete → Confirmed
Revision history for this message
jablko (ms419) wrote :
Download full text (9.8 KiB)

Thanks Chuck, I had a chance this evening to test with the Hardy alpha 4 live CD and indeed, I no longer see the kernel oops. The kernel oops I used to get is below.

So the workaround mentioned in the Debian bug report now works. Changing my /etc/auto.smb as follows enables me to connect to my Ubuntu Samba server with autofs:

--- /etc/auto.smb 2007/03/29 15:27:45 1.1
+++ /etc/auto.smb 2008/01/18 16:08:28
@@ -24,6 +24,7 @@
        mountopts="$mountopts,credentials=$credfile"
        smbopts="-A $credfile"
 else
+ mountopts="$mountopts,sec=none"
        smbopts="-N"
 fi

So "mount.smb -o guest" works:

ket% sudo mount.smb //mog.local/share /mnt -o guest
Anonymous login successful
ket%

- but "mount.cifs -o guest" does not work:

ket% sudo mount.cifs //mog.local/share /mnt -o guest
mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
ket%

- but "mount.cifs -o sec=none" does work:

ket% sudo mount.cifs //mog.local/share /mnt -o sec=none
ket% ls /mnt
Movies MythVideo
ket%

So, *should* "mount.cifs -o guest" work like "mount.smb -o guest", or should /etc/auto.smb use "sec=none"?

Much thanks for all your help with this issue Chuck, Jack

Jan 18 09:44:16 ket kernel: CIFS VFS: Send error in SessSetup = -13
Jan 18 09:44:16 ket kernel: CIFS VFS: cifs_mount failed w/return code =
-13
Jan 18 09:44:27 ket kernel: CIFS VFS: Send error in SessSetup = -13
Jan 18 09:44:27 ket kernel: CIFS VFS: cifs_mount failed w/return code =
-13
Jan 18 09:46:23 ket kernel: BUG: unable to handle kernel NULL pointer
dereference at virtual address 00000000
Jan 18 09:46:23 ket automount[4818]: mount(generic): failed to
mount //mog.local/print (type cifs) on /smb/mog.local/print
Jan 18 09:46:23 ket kernel: printing eip:
Jan 18 09:46:23 ket kernel: f8f48183
Jan 18 09:46:23 ket kernel: *pde = 00000000
Jan 18 09:46:23 ket kernel: Oops: 0000 [#1]
Jan 18 09:46:23 ket kernel: SMP
Jan 18 09:46:23 ket kernel: Modules linked in: nls_iso8859_1 cifs i915
drm rfcomm l2cap bluetooth ppdev parport_pc lp parport button ac battery
autofs4 ipv6 acpi_cpufreq cpufreq_conservative cpufreq_powersave
cpufreq_stats cpufreq_userspace cpufreq_ondemand freq_table fuse
firewire_sbp2 loop joydev tsdev snd_hda_intel pcmcia snd_pcm_oss
snd_mixer_oss snd_pcm sdhci ipw3945 snd_timer mmc_core ieee80211
ieee80211_crypt yenta_socket rsrc_nonstatic pcmcia_core rtc snd iTCO_wdt
firmware_class i2c_i801 i2c_core soundcore snd_page_alloc psmouse
serio_raw intel_agp agpgart evdev ext3 jbd mbcache dm_mirror dm_snapshot
dm_mod sg sr_mod sd_mod cdrom 8139cp ata_piix ata_generic libata
scsi_mod firewire_ohci firewire_core crc_itu_t 8139too mii ehci_hcd
generic ide_core uhci_hcd usbcore thermal processor fan
Jan 18 09:46:23 ket kernel: CPU: 0
Jan 18 09:46:23 ket kernel: EIP: 0060:[<f8f48183>] Not tainted VLI
Jan 18 09:46:23 ket kernel: EFLAGS: 00010212 (2.6.22-3-686 #1)
Jan 18 09:46:23 ket kernel: EIP is at cifs_find_tcp_session+0x77/0xc0
[cifs]
Jan 18 09:46:23 ket kernel: eax: c747dd00 ebx: 00000000 ecx:
0000001f edx: c747dd7c
Jan 18 09:46:23 ket kernel: esi: f688c569 edi: 00000000 ebp:
f688c500 esp: c747dca4
Jan 18 ...

Chuck Short (zulcss)
Changed in samba:
status: Confirmed → Fix Released
Revision history for this message
Forest (foresto) wrote :

Does "fix released" mean that something was changed in an upcoming samba release such that sec=none is no longer required for guest connections? Or, will we have to use sec=none forever?

Revision history for this message
Thierry Carrez (ttx) wrote :

It means this bug (not able to connect as guest using CIFS) was fixed. Reading man mount.cifs shows that you should use sec=none on connections with the NULL user ("guest" connections), so that's not a bug that will be fixed.

Changed in samba:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.