Hide Forgot
Description of problem: I get this error while trying to mount home directory from Samba 3.5.8 server: Apr 27 14:39:44 localhost kernel: [14858.888596] CIFS VFS: server 192.168.0.12 of type Samba 3.5.8 returned unexpected error on SMB posix open, disabling posix open support. Check if server update available. We use the 'pam_mount' package to mount Samba home directories. It is working in our labs with Fedora 13... However, now that this error disables 'SMB posix open' we are unable to use Samba for home directories. Here are our mount options (/etc/security/pam_mount.conf.xml): <volume fstype="cifs" server="ada.info.polymtl.ca" user="*" path="%(USER)" mountpoint="/usagers/%(USER)" options="dir_mode=0700,file_mode=0600,serverino,nobrl" /> On the server side, 'unix extensions' are enabled. Kernel version on the fedora-15-beta1 client: 2.6.38.3-18.fc15.i686.PAE
(In reply to comment #0) > > I get this error while trying to mount home directory from Samba 3.5.8 server: > Are you sure you're getting this on mount? Or are you getting it when doing some sort of access of the actual mount?
I tried to reproduce this mounting by hand to a server of the same version, but was unable to make this error message pop. What may be most helpful is a capture so I can see what's happening on the wire. Instructions of how to do that are here: https://wiki.samba.org/index.php/LinuxCIFS_troubleshooting#Wire_Captures
Created attachment 495791 [details] Wire capture for samba communications Here's the capture as requested... I've also tried to mount manually without pam_mount using this command: mount.cifs //sambaserver/p302568 /mnt/cifs/ -o user=p302568,password=ut87nb,serverino,nobrl And I cannot reproduce the error I get with pam_mount. Here's the verbose log (I've take out the real servername, ip, username): Apr 29 10:37:38 localhost sshd[1455]: pam_mount(misc.c:380): 50 22 0:39 / /usagers/username rw,relatime shared:3 - cifs //sambaserver/username/ rw,unc=\\sambaserver\username,username=username,uid=19062,forceuid,gid=7006,forcegid,addr=192.168.0.100,posixpaths,serverino,acl,rsize=16384,wsize=57344,actimeo=1 Apr 29 10:37:38 localhost sshd[1455]: command: 'pmvarrun' '-u' 'username' '-o' '1' Apr 29 10:37:38 localhost sshd[1460]: pam_mount(misc.c:38): set_myuid<pre>: (ruid/rgid=0/0, e=0/0) Apr 29 10:37:38 localhost sshd[1460]: pam_mount(misc.c:38): set_myuid<post>: (ruid/rgid=0/0, e=0/0) Apr 29 10:37:38 localhost sshd[1455]: pam_mount(pam_mount.c:440): pmvarrun says login count is 1 Apr 29 10:37:38 localhost sshd[1455]: pam_mount(pam_mount.c:645): done opening session (ret=0) Apr 29 10:37:39 localhost kernel: [ 315.792692] CIFS VFS: server 192.168.0.100 of type Samba 3.5.8 returned unexpected error on SMB posix open, disabling posix open support. Check if server update available.
Thanks. wireshark still doesn't decode posix opens correctly, but I can dissect it by hand... OpenFlags = 0x02 PosixOpenFlags = 0x42 (SMB_O_WRONLY | SMB_O_RDWR) !?! Permissions = 0x1c0 (0700) Level = 0x200 So, the PosixOpenFlags look very wrong, but maybe I'm decoding it incorrectly. I'll double check...
Oh, duh... It's SMB_O_WRONLY|SMB_O_TRUNC, so that should be fine. This looks legit to me, so this may be a samba bug.
Ok, I can reproduce this now with a small C program that opens a file O_WRONLY|OTRUNC. Samba sends back STATUS_INVALID_PARAMETER for some odd reason. This looks like a samba bug, but I'll do a bit more investigation to be sure.
Yep, samba bug I think... call_trans2setfilepathinfo(6) testfile (fnum -1) info_level=521 totdata=18 smbd_do_setfilepathinfo: testfile (fnum -1) info_level=521 totdata=18 smb_posix_open: invalid create mode 0x40 error packet at smbd/error.c(160) cmd=50 (SMBtrans2) NT_STATUS_INVALID_PARAMETER 0x40 is SMB_O_TRUNC and that should clearly be valid on its own.
From smb_posix_open in the samba sources: if((wire_open_mode & (SMB_O_CREAT | SMB_O_EXCL)) == (SMB_O_CREAT | SMB_O_EXCL)) { create_disp = FILE_CREATE; } else if((wire_open_mode & (SMB_O_CREAT | SMB_O_TRUNC)) == (SMB_O_CREAT | SMB_O_TRUNC)) { create_disp = FILE_OVERWRITE_IF; } else if((wire_open_mode & SMB_O_CREAT) == SMB_O_CREAT) { create_disp = FILE_OPEN_IF; } else if ((wire_open_mode & (SMB_O_CREAT | SMB_O_EXCL | SMB_O_TRUNC)) == 0) { create_disp = FILE_OPEN; } else { DEBUG(5,("smb_posix_open: invalid create mode 0x%x\n", (unsigned int)wire_open_mode )); return NT_STATUS_INVALID_PARAMETER; } If O_TRUNC is not used with O_CREAT the above fails. It's completely valid to use O_TRUNC on its own in POSIX however.
Luc, this bug is upstream too. It might not hurt to open a bug for this at bugzilla.samba.org as well...
Ok, it's done: https://bugzilla.samba.org/show_bug.cgi?id=8111
Looks like this has been fixed quite a while ago. Closing bug report.