LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   symbolic links and permissions (http://www.linuxquestions.org/questions/linux-newbie-8/symbolic-links-and-permissions-453234/)

jcai 06-09-2006 02:55 PM

symbolic links and permissions
 
is there any way to modify the permissions of the file that a symbolic link points to through the symbolic link? ie: never having to explicity change the permissions on the real file itself?

Berhanie 06-09-2006 03:37 PM

From the chmod man page:
Quote:

...for each symbolic link listed on the command line, chmod changes the permissions of the pointed-to file.

gilead 06-09-2006 03:37 PM

The default behaviour of chmod is to change the behaviour of the file pointed to by the link if the link is one of the command line arguments to chmod. However, chmod will ignore links found during recursive directory searches. From man chmod (for chmod 5.96 on Slackware):
Code:

      chmod never changes the permissions of symbolic links; the chmod system call cannot change their  per-
      missions.  This is not a problem since the permissions of symbolic links are never used.  However, for
      each symbolic link listed on the command line, chmod changes the permissions of the  pointed-to  file.
      In contrast, chmod ignores symbolic links encountered during recursive directory traversals.



All times are GMT -5. The time now is 09:41 PM.