Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about a command #5

Open
noisecode3 opened this issue Oct 14, 2024 · 0 comments
Open

Question about a command #5

noisecode3 opened this issue Oct 14, 2024 · 0 comments

Comments

@noisecode3
Copy link

Hi, I noticed when we run this command to set some permission for the source

find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

if it had some symlink that would point to a root file or directory ?? that could change the permission of a root own file, that could be really dangerous right ? When we unpack the tar ball its a mystery back box sometimes and that could go really wrong.
This one should ignore the symlinks with "! type l"? I think that is more safe? or am I wrong ? tell me.

find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
 ! -type l -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
 ! -type l -exec chmod 644 {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant