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

'permissions-fixing shell script' fails on directories with spaces in them #323

Open
hansvana opened this issue Sep 24, 2016 · 1 comment

Comments

@hansvana
Copy link

My /user/pages has dirs and files in it with spaces in the name, which makes the suggested permissions-fixing shell script fail:

Say I have a ./user/pages/this has spaces/default.md:

chmod: cannot access ‘./user/pages/this’: No such file or directory
chmod: cannot access ‘has’: No such file or directory
chmod: cannot access ‘spaces/default.md’: No such file or directory

However, after some googling, I found this script to work for me:

chown foo:bar .
chown -R foo:bar *
find . -type f -exec chmod 664 {} \;
find ./bin -type f -exec chmod 775 {} \;
find . -type d -exec chmod 775 {} \;
find . -type f -exec chmod +s {} \;
umask 0002

I don't know enough about the subject matter to be sure this does the same thing as the suggested script, by I just thought it ought to be looked at.

@ghost
Copy link

ghost commented Dec 24, 2016

find -exec is extremely slow but supports most systems. find . -print0 | xargs -0 is the right way but doesn't work in broken systems (aka OSX). My opinion is that using spaces in path, specially in a web directory, is a bad practice and the script is fine in its current form.

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