Bug 4345 - invalid symbolink links resolving
invalid symbolink links resolving
Status: RESOLVED INVALID
Product: CifsVFS
Classification: Unclassified
Component: user space tools
2.6
x86 Linux
: P3 normal
: ---
Assigned To: Steve French
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-01-17 09:49 UTC by Sébastien Desbois
Modified: 2012-04-06 10:56 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sébastien Desbois 2007-01-17 09:49:53 UTC
Context:
Attempting to mount a samba share from a linux mandriva LE 2005.
The share contains symbolink links to another directory on the Samba server.

The problem:
after a successful mount.cifs command, i list the content of the mounted share. The symbolink links are shown as invalid, because referencing to a directory that doesn't exists on the local filesystem. Instead of resolving the links' targets on the remote Samba server, it attempts to locally resolve them.

Hope i've been clear enough.
Comment 1 Marc Chamberlin 2007-03-18 13:09:54 UTC
Dunno how to vote for this bug so will just add a "ditto for me" comment and see if that works. Am using SuSE 10.1 and 10.2 and this bug is a serious showstopper for us as it is causing some scripts to fail and we have to spend a lot of time working around it.

Samba version 3.0.22-13.18-SUSE-CODE10
Samba version 3.0.23d-19.2-1179-SUSE-SL10.2


   Marc..
Comment 2 Shirish S. Pargaonkar 2009-10-13 04:57:22 UTC
Is this still a problem?  Because, with Samba Version 3.4.0-GIT-26e114b-devel,
I do not see a difference between output of ls -l command on the local
filesystem on server and ls -l command on the remote (mounted) filesyetem
on the client.

Can you state an example of the error you encounter?
Comment 3 Shirish S. Pargaonkar 2009-10-30 12:57:45 UTC

With unix extensions enabled, cd to a symbolic link should have worked right?
And I do not see invalid links at all, what am I missing?

------------------ client --------------------
cifstest6:/usr/src/linux.ssp.052109.1/cifs-2.6 # echo 1 > /proc/fs/cifs/LinuxExtensionsEnabled

cifstest6:/usr/src/linux.ssp.052109.1/cifs-2.6 # mount -t cifs //cifstest8./smbshare8 /mnt/smb_b
 -o user=root,pass=<password>

cifstest6:/usr/src/linux.ssp.052109.1/cifs-2.6 # cd /mnt/smb_b
cifstest6:/mnt/smb_b # ls -l
total 4
drwxr-sr-x 2 root video  0 Oct 13 08:35 MENUDIR
-rw-r--r-- 1 root video 14 Oct 13 03:15 MENUFILE
lrwxrwxrwx 1 root video  4 Oct 30 09:06 linkmotd -> motd
lrwxrwxrwx 1 root video  8 Oct 30 09:46 linknodir -> ../nodir
lrwxrwxrwx 1 root video 10 Oct 30 09:46 linktestdir -> ../testdir
-rw-r--r-- 1 root root   0 Dec 10  2008 motd
-rw-r--r-- 1 root video  0 Oct 13 02:45 motdd
lrwxrwxrwx 1 root video  3 Oct 30 09:22 nolink -> xxx
drwxrwsr-x 2 root video  0 Aug 27 10:14 test8

cifstest6:/mnt/smb_b # cd linktestdir
-bash: cd: linktestdir: No such file or directory
cifstest6:/mnt/smb_b # cd ../testdir
-bash: cd: ../testdir: No such file or directory

cifstest6:/usr/src/linux.ssp.052109.1/cifs-2.6 # umount /mnt/smb_b
cifstest6:/usr/src/linux.ssp.052109.1/cifs-2.6 # cd /mnt/smb_b/testdir
cifstest6:/mnt/smb_b/testdir # ls
lfile
--------------------------------------------


------------------ server --------------------------
cifstest8:/tmp/smbshare8 # pwd
/tmp/smbshare8
cifstest8:/tmp/smbshare8 # ls -l
total 4
drwxr-sr-x 2 root video 80 Oct 13 08:35 MENUDIR
-rw-r--r-- 1 root video 14 Oct 13 03:15 MENUFILE
lrwxrwxrwx 1 root video  4 Oct 30 09:06 linkmotd -> motd
lrwxrwxrwx 1 root video  8 Oct 30 09:46 linknodir -> ../nodir
lrwxrwxrwx 1 root video 10 Oct 30 09:46 linktestdir -> ../testdir
-rw-r--r-- 1 root root   0 Dec 10  2008 motd
-rw-r--r-- 1 root video  0 Oct 13 02:45 motdd
lrwxrwxrwx 1 root video  3 Oct 30 09:22 nolink -> xxx
drwxrwsr-x 2 root video 72 Aug 27 10:14 test8
cifstest8:/tmp/smbshare8 # cd linktestdir
cifstest8:/tmp/smbshare8/linktestdir # dir
total 0
-rw-r--r-- 1 root root 0 Oct 30 10:27 sfile



The problem:
after a successful mount.cifs command, i list the content of the mounted share.
The symbolink links are shown as invalid, because referencing to a directory
that doesn't exists on the local filesystem. Instead of resolving the links'
targets on the remote Samba server, it attempts to locally resolve them.
Comment 4 Shirish S. Pargaonkar 2009-10-30 13:38:03 UTC
I do not see the problem of symbolic links shown as invalid when listing a
mounted directory. If the parallel direcotry structure does not exist on the 
client machine, changing to a symbolically linked directory generates an 
errorbut if a parallel directory structure exists, then the change directory 
works but directory is changed to local machine's directory and notthe 
directory symbolically linked on the server.

If the bug was opened to address the first issue (invalid symbolic links), then 
it does not exist anymore.
Comment 5 Jeff Layton 2012-04-06 10:56:49 UTC
The problem here is a fundamental difference in how samba treats symbolic
links when unix extensions are enabled on the connection. With them enabled,
symlinks are sent as-is over the wire. With them disabled, they are either
not presented or are followed (depending on local policy).

I think we just have to consider this to be INVALID since this looks like
it's behaving as expected. If you don't think so, then consider reopening
this bug and we'll move the component to samba proper, and pursue it there.