symlink owner question

Nico Kadel-Garcia nkadel at
Thu Apr 27 01:06:19 UTC 2017

On Tue, Apr 25, 2017 at 3:10 PM, Uri Simchoni via samba-technical
<samba-technical at> wrote:
> Hi,
> Can anyone think of a case where the owner of a symlink matters, that
> is, suppose the user creates a symlink via SMB (POSIX extensions), and
> the resulting link owned by the wrong user.

Not... easily. For auditing ownership of the relevant content, OK, it
could be confusing. But in order to reset the symlink, the user needs
*directory* write access, not write access to the symlink. It can be
confusing for users to have a symlink to a file that is oowned by,
say, "root" but is owned locally by the local "user".

> We have such behavior if:
> 1. The user is in "admin users" --> smbd runs as root and link owned by
> root.
> 2. "inherit owner" is enabled - the link has the creator's owner, not
> the inherited owner.
> *if* it matters, I can't think of a way of reliably fixing it:
> - lchown is a bit racy because the symlink may have been superseded with
> something else.
> - fchown - the only way I found for opening the symlink is using O_PATH,
> and that doesn't support fchown (documented and experimentally verified).
> I have produced a failing test to demonstrate the issue (see attached),
> but then got stuck with fixing it :(, so perhaps it's better to declare
> it as a non-issue....
> Thoughts?
> Uri.

More information about the samba-technical mailing list