[ubuntu-za] Symbolic Links

Simon Cross hodgestar at gmail.com
Fri Nov 21 23:26:17 GMT 2008


On Sat, Nov 22, 2008 at 12:29 AM, Charl Wentzel
<charl.wentzel at vodamail.co.za> wrote:
> I've made symbolic links to a few text files from one directory to another
> using:
>
> ln -s /sourcedir/* /targetdir
>
> The original files have the permissions "-wr--r--r-", but the newly created
> symbolick links have the permissions "-wrxwrxwrx". (Sorry, I don't like to
> octal notation very much)
>
> I'm pretty sure this is not right?  Should the permissions not be
> maintained?  I never actually took notice before.

This is normal. From "man symlink":

"The  permissions of a symbolic link are irrelevant; the ownership is
ignored when following the link, but is checked when removal or
renaming of the link is requested and the link is in a directory with
the sticky bit (S_ISVTX) set."

The permissions are irrelevant because the only action one can take on
the symlink (rather than the file or directory pointed to) is to
delete it, and the permissions for that are determined by the
permissions of the directory the symlink is in.

Schiavo
Simon



More information about the ubuntu-za mailing list