LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   chmod on a symbolic link (https://www.linuxquestions.org/questions/linux-general-1/chmod-on-a-symbolic-link-550288/)

sharathkv25 04-30-2007 11:10 PM

chmod on a symbolic link
 
Code:

tpdev2 # ls -lad /nsms/omfs/app/
dr-xr-xr-x  12 otroot    tproot        8192 Apr 30 20:41 /nsms/omfs/app/

tpdev2 # ln -s /nsms/omfs/app /opt/omfs

lrwxr-x---  1 root      sys            14 Apr 30 21:00 osmf -> /nsms/omfs/app

I want the symbolic link "omfs" to have the same 555 permissions as the /nsms/osmf/app folder.

How do that?

A simple "chmod 555 /opt/omfs" is not changing the permission.

I am on HPUX.

Thanks

gilead 04-30-2007 11:23 PM

Are you finding that otroot or tproot can't access /nsms/omfs/app via the osmf link on HPUX? On Linux, the permissions of the link wouldn't matter because they aren't used. The permissions of the file/directory pointed by the link are used. The following is from the Linux man page for chmod:
Code:

      chmod  never  changes the permissions of symbolic links; the chmod system call cannot change
      their permissions.  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 permis-
      sions of the pointed-to file.  In contrast, chmod ignores symbolic links encountered  during
      recursive directory traversals.


reverse 05-01-2007 12:05 AM

I believe the HPUX chmod will simply change the modes of the "linked to" file as opposed to the "link file" itself. What version of HPUX are we talking about?


All times are GMT -5. The time now is 12:59 PM.