Bug 150403

Summary: cifs mounted directories dont contain . / ..
Product: [openSUSE] SUSE Linux 10.1 Reporter: Bjoern Jacke <bjacke>
Component: KernelAssignee: Steve French <sfrench>
Status: RESOLVED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: asklein, sfrench, suse-beta, vetter
Version: Beta 3   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Bjoern Jacke 2006-02-13 13:33:39 UTC
as root I mounted a cifs share from a XP SP2 box like this:

mount -t cifs //192.168.16.128/f$ /mnt/1 -ouser=administrator%geheim

a ls -la show this:

pell:~ # ls -la /mnt/1
total 0
drwxrwxrwx 1 root root 0 Oct 24 02:38 RECYCLER
drwxrwxrwx 1 root root 0 Dec 13 00:31 System Volume Information
drwxrwxrwx 1 root root 0 Feb 11 19:43 down
drwxrwxrwx 1 root root 0 Feb 12 23:59 temp

first question was: where is "." and ".." ?

then as non-root user I tried to create file:

bjacke@pell:~> touch /mnt/1/test
touch: Setzen der Zeiten für „/mnt/1/test“: Keine Berechtigung

but though it claims I wouldn't have the rights it created it:

ls -la /mnt/1/
insgesamt 0
drwxrwxrwx 1 root root 0 2006-02-11 19:43 down
drwxrwxrwx 1 root root 0 2005-10-24 02:38 RECYCLER
drwxrwxrwx 1 root root 0 2005-12-13 00:31 System Volume Information
drwxrwxrwx 1 root root 0 2006-02-12 23:59 temp
-rw-r--r-- 1 root root 0 2006-02-13 14:22 test

still no "." and no ".." but: a "test" exists though I had no rights due to the message.

uname -a
Linux pell 2.6.16-rc2-git2-3-default #1 Mon Feb 6 23:30:07 UTC 2006 i686 i686 i386 GNU/Linux
Comment 1 Bjoern Jacke 2006-02-13 13:40:09 UTC
ah, I overlooked the "Setzen der Zeiten" - so access was not totally denied ;-)
But the question for the missing "." and ".." remains.
Comment 3 Chris L Mason 2006-02-16 15:06:08 UTC
Steve, could you please take a look?
Comment 4 Steve French 2006-03-19 22:20:04 UTC
I have only seen one case in which a server fails to return . and .. in search results, and I have never seen it with Windows.  It would also be useful to see the output of "cat /proc/fs/cifs/DebugData" (that lets us see whether your session is authenticated by the server as "guest" or a real user) and it also might be helpful to see an ethereal trace to see whether the server really failed to return . and .. in the search results or whether those entries were discarded by the client for some unknwon reason
Comment 5 Bjoern Jacke 2006-03-25 10:01:40 UTC
Steve: this happens with all XP (tested just SP2) versions if you mount the default C$ disk root share. It should be reproducable for you very easy. If not I'm going to collect and send you more degug data...
Comment 6 Steve French 2006-04-10 20:04:28 UTC
This seems to be true - Windows server will not return . and .. on a share exporting the root of a drive.  Presumably POSIX requires . and .. to be returned no matter what the server says?

Also want to verify that this is important enough for me to code around this behavior on the client (ie add code to fs/cifs/readdir.c for inserting . and .. in search results when the server forgets to return them).
Comment 7 Matthias Fruehauf 2006-05-04 11:30:32 UTC
Steven, do you need more information from Björn?
Comment 8 Steve French 2006-06-12 04:21:12 UTC
This is fixed in cifs 1.42 (IIRC you have version 1.40 of cifs).  The changes to cifs_readdir to fix this and a loosely related search rewind problem were rather large - and rather than make a patch for just these available I will be making a larger update version of cifs 1.44 available later in the week (which also will include NTLMv2 security and some key fixes for POSIX locking which are more important).
Comment 9 Steve French 2006-06-19 02:35:59 UTC
Could you confirm that this is fixed by the readdir change (which is also in current cifs) which is included in the rollup fixed version: http://us1.samba.org/samba/ftp/cifs-cvs/cifs-1.44.tar.gz
Comment 10 Greg Kroah-Hartman 2006-08-14 05:38:54 UTC
This is now fixed in our kernels, right Steve?
Comment 11 Steve French 2006-08-14 18:43:30 UTC
This was fixed in cifs version 1.42 (I think SLES10 is at 1.44 but will check).
Comment 12 Steve French 2006-08-14 19:24:19 UTC
My test machine had 2.6.16.11-7 kernel which did not have this fix (it had cifs version 1.40).  I don't have a more recent SLES10 build installed (to see if it was picked up as we had suggested)

The cifs version 1.44 above (as well as slight more current http://us1.samba.org/samba/ftp/cifs-cvs/cifs-1.45.tar.gz) do have this fix (it was put into mainline with a pair of changesets on 4/23/06).

Comment 13 Greg Kroah-Hartman 2006-08-14 19:37:13 UTC
SLES10 has 2.6.16.23 or so.  I do not think you upgraded the sifs layer
in the stable releases :).

So, please backport the fix needed, if you wish to fix this, or close it out
as something that you will not support.
Comment 14 Steve French 2006-08-14 23:03:38 UTC
There are cifs fixes in the stable series, but even stripped down this fix would be a little too large (perhaps 30 lines of code or so) than is typical for the stable release patch and it does not fix a serious enough problem as far as I could tell (it only affects shares of the root of a drive, not all servers have the problem of forgetting to return .. etc.).

We will continue to track/test the larger cifs backport for SLES9 and SLES10 service packs (and work with jra etcc) - as there are key fixes in there necessary for
1) NTLMv2 (stronger authentication requirement)
2) marking smbfs obsolete
3) fixing posix byte range locking
that are more important (and it includes a rollup of the lower severity bug fixes) but it would be too high risk to break them apart.
Comment 15 Stephan Kulow 2008-06-25 09:35:38 UTC
mass reopening all SuSE Linux bugs that are set to REMIND+LATER to change the resolution to WONTFIX (adapting to new policy)
Comment 16 Stephan Kulow 2008-06-25 09:37:46 UTC
mass reopening all SuSE Linux bugs that are set to REMIND+LATER to change the resolution to WONTFIX (adapting to new policy)
Comment 17 Stephan Kulow 2008-06-25 09:42:13 UTC
mass reopening all SuSE Linux bugs that are set to REMIND+LATER to change the resolution to WONTFIX (adapting to new policy)
Comment 18 Stephan Kulow 2008-06-25 09:53:39 UTC
Closing old LATER+REMIND bugs as WONTFIX - if you still plan to work on it, feel free to reopen and set to ASSIGNED.

In case the report saw repeated reopen comments, it's due to bugzilla timing out on the huge request ;(