forked from leifj/multiverse
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from SUNET/john-permissions-fix
Enforce more strict permissions for files in Cosmos
- Loading branch information
Showing
4 changed files
with
61 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
# | ||
# Set Cosmos directory permissions so that | ||
# the files cannot be read by anyone but root, | ||
# since it's possible that the directory | ||
# can contain files that after applying the | ||
# overlay to / only should be read or writable | ||
# by root. | ||
|
||
set -e | ||
self=$(basename "$0") | ||
|
||
if ! test -d "$COSMOS_BASE"; then | ||
test -z "$COSMOS_VERBOSE" || echo "$self: COSMOS_BASE was not found. Aborting change of permissions." | ||
exit 0 | ||
fi | ||
|
||
args="" | ||
if [ "x$COSMOS_VERBOSE" = "xy" ]; then | ||
args="-v" | ||
fi | ||
|
||
chown ${args} root:root "$COSMOS_BASE" | ||
chmod ${args} 750 "$COSMOS_BASE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
# | ||
# Set Cosmos directory permissions so that | ||
# the files cannot be read by anyone but root, | ||
# since it's possible that the directory | ||
# can contain files that after applying the | ||
# overlay to / only should be read or writable | ||
# by root. | ||
|
||
set -e | ||
self=$(basename "$0") | ||
|
||
if ! test -d "$COSMOS_BASE"; then | ||
test -z "$COSMOS_VERBOSE" || echo "$self: COSMOS_BASE was not found. Aborting change of permissions." | ||
exit 0 | ||
fi | ||
|
||
args="" | ||
if [ "x$COSMOS_VERBOSE" = "xy" ]; then | ||
args="-v" | ||
fi | ||
|
||
chown ${args} root:root "$COSMOS_BASE" | ||
chmod ${args} 750 "$COSMOS_BASE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters