Does "chmod -R 700 directory_1" update directories pointed by softlinks?

0

Does "chmod -R 700 directory_1" update directories under softlinks? Forexample, there is a softlink under directory_1 folder: "my_softlink". And my_softlink points to a directory_2.

Will permissions of directory_2's and files under it be updated to 700 when I do "chmod -R 700 directory_1"

Best Regards

alwbtc

Posted 2012-09-18T08:20:26.750

Reputation: 2 367

Seems like you could just try it and see... – martineau – 2012-09-18T08:45:49.397

Answers

1

From the man page:

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 permissions of the pointed-to file. In contrast, chmod ignores symbolic links encountered during recursive directory traversals.

So the answer is, no, it will not change anything for directory_2.

Stefan Seidel

Posted 2012-09-18T08:20:26.750

Reputation: 8 812