I have a directory that is shared via samba. Now I mount a share on another computer to a directory that is inside this share. The problem is that this mounted share appears as empty directory when accessing the share.
Does anyone know why this happens or how one would correctly be able to access another computer's share as if it were part of another share?
Added example:
If it helps, here is how such a scenario can be created:
# on host assume that we are `user1`
# assume that we use `[homes]` in `smb.conf` so our home directory is shared
mkdir -p d1/d2 && cd d1
# assume that there is a `host2`
# with a share named `share2` and a user `user2`
sudo mount.cifs -o username=user2 '//host2/share2' d2
# we check and see that it works and files from `share2` are visible
ls d2
# now we try to use this share from anywhere, for example locally
echo "ls d1/d2" | smbclient '\\localhost\user1' -U user1
# now we will only see an empty directory
/etc/mtab
(linked toproc/mount
in Debian and derivatives), but I wouldn't expect every directory access to check this file, even if it is mirrored or indexed in memory, though maybe it does.