Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 55926

Summary: smbfs on Linux following symlinks locally, not remotely
Product: Gentoo Linux Reporter: Jeff Connelly <shellreef+gentoo>
Component: Current packagesAssignee: Gentoo's SAMBA Team <samba>
Status: RESOLVED NEEDINFO    
Severity: major    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Jeff Connelly 2004-07-02 17:48:35 UTC
When accessing a mounted filesystem using smbfs on a Samba FreeBSD server, 
symlinks are followed locally. "follow symlinks = yes" is set in the
remote smbd.conf (this is also the default). Other clients can follow
the link without problems.

I put this as "major" because it prevents me from using my Samba server
with Linux (I use symlinks extensively), although others may be unaffected.

Thanks,
-Jeff Connelly

Reproducible: Always
Steps to Reproduce:
bash-2.05b$ sudo mount -t smbfs //server/jeff /mnt/server -o ip=10.0.0.1
Password: 
bash-2.05b$ cd /mnt/server
bash-2.05b$ cd xyz
bash: cd: xyz: No such file or directory
bash-2.05b$ file xyz
xyz: broken symbolic link to `/mnt/200gb/xyz'
bash-2.05b$ mkdir /mnt/200gb
bash-2.05b$ mkdir /mnt/200gb/xyz
bash-2.05b$ cd xyz
bash-2.05b$


Actual Results:  
Symlinks on smbfs are followed to the local filesystem.
This is unexpected, not only is it a security risk but
shadows access to remote files.

Expected Results:  
Symlinks on smbfs should be followed on the remote filesystem.
The client should have no knowledge of the underlying symlinks.

SMB clients that work correctly:

- smbclient (tried on Linux and FreeBSD):
bash-2.05b$ smbclient -V
Version 3.0.4
bash-2.05b$ smbclient -I 10.0.0.1 //server/jeff
Password: 
Domain=[CONNELLY] OS=[Unix] Server=[Samba 3.0.4]
smb: \> cd xyz
smb: \xyz\> 

- Windows 2000
- Windows XP
X: is mapped to \\server\jeff
X:\>
X:\>cd xyz
X:\xyz>

- FreeBSD smbfs
1 sudo mount_smbfs -I 10.0.0.1 //server/jeff /mnt/server
Password:
0 cd /mnt/server
0 cd xyz
0 pwd
/mnt/server/xyz
0 

(Note: all of the above clients also correctly allow
directory listing, which is not shown here for brevity.)


bash-2.05b$ sudo emerge info|more
Gentoo Base System version 1.4.16
Portage 2.0.50-r8 (default-x86-2004.0, gcc-3.3.3, glibc-2.3.3.20040420-r0, 2.6.7
-gentoo-r6)
=================================================================
System uname: 2.6.7-gentoo-r6 i686 AMD Athlon(tm) 64 Processor 3000+
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=i686 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2
/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=i686 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linu
x/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X alsa apm arts avi berkdb cdr crypt cups dvd encode esd foomaticdb gdbm gi
f gnome gpm gtk gtk2 imlib jpeg kde libg++ libwww mad mikmod motif mpeg ncurses 
nls oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl sl
ang spell ssl svga tcpd truetype x86 xml2 xmms xv zlib"

bash-2.05b$ uname -a 
Linux amd64 2.6.7-gentoo-r6 #3 Wed Jun 30 20:50:28 PDT 2004 i686 AMD Athlon(tm)
64 Processor 3000+ AuthenticAMD GNU/Linux
bash-2.05b$
Comment 1 Michael Glauche (RETIRED) gentoo-dev 2004-07-07 01:05:17 UTC
Hmm, this could be connected to the problem other people did report with smbfs and kernel 2.6, this combination seems unstable. Can you check if smbfs works with a 2.4 kernel ?
Comment 2 SpanKY gentoo-dev 2004-08-19 20:50:28 UTC
yes, this seems like a kernel bug, not a samba bug