[NTLUG:Discuss] Is there a way to change permissions of a link
Neil Aggarwal
neil at JAMMConsulting.com
Wed Nov 1 18:31:31 CST 2000
Steve:
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
Can the symlink have different permissions than 777?
Neil.
--
Neil Aggarwal, President & CEO
JAMM Consulting, Inc. -- (972) 612-6056, http://www.JAMMConsulting.com
Custom Programming in Java, C++, HTML, perl
On Wed, 1 Nov 2000, MadHat wrote:
> Neil Aggarwal wrote:
> >
> > Steve:
> >
> > Thank you for the long disucssion of how symbolic links work.
> > It was really very informative.
> >
> > But my initial questions still remains. Since the link is just
> > a file, it has its own set of permissions. Shoudlnt I be able to make
> > the symlink readonly but have the file it points to be read/write?
> >
> > If so, how can I do this?
>
> Reread the explanation...
>
> a sym link is not a file (it does not have permissions), but an entry in
> the directory that point to the file... The file is what has the
> permissions, not the directory entry. A hard link would have the same
> permissions as the origional file because that is stored in the INODE...
>
> # touch file
> # ls -l
> -rwxr-xr-x 2 root root 0 Nov 1 16:40 file
>
> # ln file this
> # ls -l
> -rwxr-xr-x 2 root root 0 Nov 1 16:40 file
> -rwxr-xr-x 2 root root 0 Nov 1 16:40 this
> # chmod 777 this
> # ls -l
> -rwxrwxrwx 2 root root 0 Nov 1 16:40 file
> -rwxrwxrwx 2 root root 0 Nov 1 16:40 this
>
>
> I hope that came out right... crappy netscape mail client...
>
> --
> MadHat at unspecific.com
> "The 3 great virtues of a programmer:
> Laziness, Impatience, and Hubris."
> --Larry Wall
> _______________________________________________
> http://ntlug.org/mailman/listinfo/discuss
>
More information about the Discuss
mailing list