BJ Quinn
2015-Feb-02 22:51 UTC
[Samba] samba share is symlink, symlink gets updated, samba doesn't catch the change
I have a couple of samba shares that point to symlinks. Basically these are last night's copy of a bunch of data. The path changes every night (YYMMDD is in the path name), so I've just got one symlink that gets updated to the path with the latest date every night. I was using an old Samba on OpenSolaris for a long time and this process was working. Using 3.6.23 on RHEL and although the symlink is getting updated to the new path every night, the share itself continues to go to what the link used to point to. The new server is about a week old, and so the data I see is from the night the server was built. That folder is still physically on the disk, but it's not what the symlink points to anymore. I've tried a service smb reload, and that didn't change anything. I also have a share that is a couple levels higher in the directory structure. When I navigate to the same symlink through that share and click on it, I get the contents of the updated link, not the old data. Seems that Samba's caching the absolute path of the symbolic link for the share and not updating it?
Sébastien Le Ray
2015-Feb-03 09:24 UTC
[Samba] samba share is symlink, symlink gets updated, samba doesn't catch the change
Hi, I guess it is some kind of protection agains symlink attacks. If a share points directly to a symlink, the symlink is expanded on startup to avoid security issues if it gets modified. Regards, Le 02/02/2015 23:51, BJ Quinn a ?crit :> I have a couple of samba shares that point to symlinks. Basically these are last night's copy of a bunch of data. The path changes every night (YYMMDD is in the path name), so I've just got one symlink that gets updated to the path with the latest date every night. > > I was using an old Samba on OpenSolaris for a long time and this process was working. Using 3.6.23 on RHEL and although the symlink is getting updated to the new path every night, the share itself continues to go to what the link used to point to. The new server is about a week old, and so the data I see is from the night the server was built. That folder is still physically on the disk, but it's not what the symlink points to anymore. I've tried a service smb reload, and that didn't change anything. I also have a share that is a couple levels higher in the directory structure. When I navigate to the same symlink through that share and click on it, I get the contents of the updated link, not the old data. Seems that Samba's caching the absolute path of the symbolic link for the share and not updating it?
BJ Quinn
2015-Feb-03 16:22 UTC
[Samba] samba share is symlink, symlink gets updated, samba doesn't catch the change
>I guess it is some kind of protection agains symlink attacks. If a share >points directly to a symlink, the symlink is expanded on startup to >avoid security issues if it gets modified.This makes sense, but is there some way to override it? Or, at least I'd think a reload would expand the symlink again, but it doesnt.