Re-export of smb mounted share displays incorrect filetype

Jeremy Allison jra at samba.org
Fri Aug 23 10:07:33 MDT 2013


On Fri, Aug 23, 2013 at 10:55:54AM -0400, Jim McDonough wrote:
> 
> 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
> information.

Hmmm. With UNIX extensions requested from the client we should always be calling
lstat. If it's a Windows client then calling stat is correct.

> 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.

Ping me on this, I'm interested in making it work !

Jeremy.


More information about the samba-technical mailing list