[NTLUG:Discuss] Is there a way to change permissions of a link

Steve Baker sjbaker1 at airmail.net
Wed Nov 1 18:52:46 CST 2000


Neil Aggarwal wrote:

> I have symlinks, and the link has different permissions than
> the file:
> 
> % ls -la
> lrwxrwxrwx 1 neil neil 4 Sep 22 07:22 myLink-> myFile
> -rw-r--r-- 1 neil neil 2276 Sep 1 15:29 myFile

Yep - that's what it always looks like.

> Can the symlink have different permissions than 777?

Not under Linux - but even if it *could* have different permissions
it wouldn't matter because for all practical purposes, Linux ALWAYS
uses the permissions of the file it links to ('myFile' in your case).

As someone else pointed out - the solution to your problem is
probably to deny write access to the DIRECTORY in which the
symlinks are stored...but I'm not 100% clear as to the effect
you are trying to achieve.

If you find all of this confusing, use the '-L' option to 'ls' - which
causes it to list the permissions (dates, ownerships, etc) of the
actual file and not those of the link.  In your case, this would result in:

  % ls -laL
  -rw-r--r-- 1 neil neil 2276 Sep 1 15:29 myLink
  -rw-r--r-- 1 neil neil 2276 Sep 1 15:29 myFile


-- 
Steve Baker   HomeEmail: <sjbaker1 at airmail.net>
              WorkEmail: <sjbaker at link.com>
              HomePage : http://web2.airmail.net/sjbaker1
              Projects : http://plib.sourceforge.net
                         http://tuxaqfh.sourceforge.net
                         http://tuxkart.sourceforge.net
                         http://prettypoly.sourceforge.net



More information about the Discuss mailing list