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

feat(templates): set ownership and permissions on private files folder #82

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ClassicCut
Copy link
Contributor

@ClassicCut ClassicCut commented Aug 28, 2020

#80

Copy link
Contributor

@finalhow finalhow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ClassicCut Forgot to mention you regarding line 248.

chown -R ${drupal_user}:${httpd_group} ${private_files_path} &
printf "Changing permissions of all files inside private files directory ${private_files_path} to rw-rw----...\n" && \
printf "Changing permissions of private files directory and all directories inside ${private_files_path} to rwxrwx---...\n" && \
chmod u=rwx,g=rwx,o= ${private_files_path}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this line (248) become redundant if the two 'find' commands below apply the correct permissions to the same path?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@finalhow I wasn't sure if the find command would apply the permissions to the containing (top-level) directory, or if the find command would only return and apply permissions to only the directories contained within that top-level private files directory.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah makes sense. Well, either way its just one chmod extra on one directory and its not recursive so no big deal.

Easy way to test if ever you need to: Run the same find command without the 'exec' bit and 'head' the output:

find <path> -type d | head

Anyway ok perfect.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ClassicCut Forgot to @ mention my reply... bah

Copy link
Contributor

@finalhow finalhow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ClassicCut Looks good!

@ClassicCut
Copy link
Contributor Author

@finalhow Added an extra check for ensuring nothing gets set on the root folder, in case the variable gets that value somehow.

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

Successfully merging this pull request may close these issues.

3 participants