Re-export of smb mounted share displays incorrect filetype
Chandler, Steven D
steven.d.chandler at intel.com
Fri Mar 6 05:06:02 MST 2015
Hello Samba developers.
I am also experiencing this problem of re-exporting a mounted share which Dion described below. This problem occured on CentOS 7 which includes Samba 4.1.1. I installed Fedora 21 which includes Samba 4.1.12 and it worked beautifully. I really want to use CentOS 7 even if it means manually building Samba from source. I reinstalled CentOS and built the latest Samba but I have the same problem. I then built 4.1.12 which is the version that worked in Fedora but it doesn't work on CentOS either.
So I think it could be related to some shared library that is different between CentOS 7 and Fedora 21. Any ideas what could be going on? Ideally this is some kind of system configuration and I can use the stock 4.1.1 included with CentOS.
On Thu, Aug 22, 2013 at 6:43 PM, Dion Stempfley
<dion.stempfley at gmail.com<https://lists.samba.org/mailman/listinfo/samba-technical>> wrote:
> I have an application that requires me to mount an SMB share from a
> netdisk and then re-export it with samba to other systems. I know that
> sounds convoluted, but that's what I am working with.
> Has anyone had any success with this type of configuration? I've seen
> notes in the archive about other filesystems like nfs but not smb.
> The linux system I am using is Fedora release 19. The client systems:
> Windows, Mac OS X, or Linux all have problems when they map the shared
> drive from linux.
> The mount of the files from the netdisk to the linux system work fine.
> Here is my /etc/fstab entry:
> //netdisk1/dion /mnt/dion cifs
> credentials=/etc/samba/credentials/smbmount.pw,auto 0 0
> Then the filesystem is shared in the smb.conf as:
> path = /mnt/dion
> read only = No
> browsable = Yes
> guest ok = no
> force user = nobody
> When I map the dion share from a windows system, all of the directories
> look like files. I can create a directory, but it will also look like a
> zero length file. From a command prompt, I can cd to one of the
> directories, but windows explorer will not.
> Here is the output from a cmd.exe on a windows file system:
> Z:\>mkdir test
> Volume in drive Z is dion
> Volume Serial Number is 476A-1FC3
> Directory of Z:\
> 08/10/2013 12:18 PM <DIR> .
> 07/15/2013 01:42 PM <DIR> ..
> 06/27/2013 04:56 PM 0 Troubleshooting
> 11/22/2012 12:39 AM 0 .bash_history
> 08/20/2013 05:57 PM 0 Documents
> 06/27/2013 02:11 PM 0 Network Trash Folder
> 06/27/2013 04:57 PM 0 Tools
> 08/22/2013 05:45 PM 0 test
> 06/27/2013 02:11 PM 0 Temporary Items
> 06/27/2013 04:56 PM 0 .ssh
> 8 File(s) 0 bytes
> 2 Dir(s) 1,982,047,387,648 bytes free
> I'm kind of out of ideas for where to look. It seems like it should work
> but it doesn't.
Yah, I'm currently working on this one. The problem comes from two
places: first, we refuse to continue to create the dos modebits
because the st_nlink from stat() comes back with 0. However, cifsfs
itself shouldn't be causing this, but somehow it's happening.
When running the stat command, the directory will have the directory
bit on, plus number of links will read 1, which should be sufficient.
but upon examining an strace of this, the stat command calls lstat(),
while smbd calls stat(), resulting in what appears to be conflicting
This can be reproduced using only smbd, cifs, and smbclient. Turning
off unix extensions on the cifs mount will trigger it. connecting to
the re-exported smbd with smbclient, doing an "ls" will show the bug.
However, doing an "ls <dirname> will not.
I'm currently at a conference but should be back to it next week.
jmcd at samba dot org
jmcd at themcdonoughs dot org
More information about the samba-technical