[Samba] How to make a symlink appear as a real file (for a Linux client)?

Kurt Weiss maillists at kwnet.at
Thu Feb 23 09:47:14 GMT 2006



Tomasz Chmielewski schrieb:
> Kurt Weiss wrote:

> 
> When it's set to no, both Windows client and Linux client (using cifs) 
> will get an error when trying to access symlinked file/dir.

but then it's the question: why it's a failure?

you wrote:

> # ls -l
> (...) acrobatreader7
> (...) addon -> /home/samba/unattended-write/packages
> Now, if I mount it on a Linux client using smbmount, symlinks point to non existing directories locally (/home/samba/unattended-write/packages exist only on a Samba server):
> # smbmount //192.168.111.172/unattended /mnt/1
> # ls -l /mnt/1
> (...) acrobatreader7/
> (...) addon -> /home/samba/unattended-write/packages
> On a Windows client, however, I can browse the files in such directories just fine.
> I would rather expect that to happen on a Linux client, too (i.e., Linux client should not see it as symlinks, but as real files/directories).
> Where can I look for a solution?
> I didn't find anything about it in smbmount nor in smb.conf manuals.

i hope, that smbfs (smbclient) recognizes the symbolic link and shows it 
as this what it is.
because if i delete the link, the original directory will stay.

AFAIK, the symlink stores the target as text. so, it's a difference to 
create the symlink with "/etc/passwd" and "../etc/passwd".
e.g.:
you create symlinks in /usr:
  cd /usr
  ln -s ../etc/passwd sympass1
  ln -s /etc/passwd sympass2
  cat sympass1: success
  cat sympass2: success
now move the links to local:
  mv sympass* local/
  cat sympass1: *fail*
  cat sympass2: success

so, if you use relative path descriptions (e.g. ../unattended-write)to 
create the symlink, it will be a solution.

maybe a hardlink will be a second solution.

AFAIK: windows clients does not recognise symbolic links, so samba has 
to handle it as directory.
advantage: global directory entries are handled correct.
disadvantage: a deletion of the symbolic link will be fatal.

-- 
--
greetings,
kurt, austria. (http://www.kwnet.at)
===================================================================
this is a posting from a samba *user* - not a samba developer.
the posting is created on the base of experiences an may be faulty.
so, if contains any mistakes, please feel free to correct it
===================================================================


More information about the samba mailing list