Skip to content

Commit

Permalink
Merge pull request openshift#926 from hardys/sanity_fixes
Browse files Browse the repository at this point in the history
Fix world-readable check in sanitychecks.sh
  • Loading branch information
stbenjam committed Feb 7, 2020
2 parents b7d5ecc + 8aa0973 commit 1c90287
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 0 additions & 3 deletions common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ export MIRROR_IMAGES=${MIRROR_IMAGES:-}
# The dev-scripts working directory
WORKING_DIR=${WORKING_DIR:-"/opt/dev-scripts"}

# The minimum amount of space required for a default installation, expressed in GB
MIN_SPACE_REQUIRED=${MIN_SPACE_REQUIRED:=80}

# variables for local registry configuration
export LOCAL_REGISTRY_PORT=${LOCAL_REGISTRY_PORT:-"5000"}
export REGISTRY_USER=${REGISTRY_USER:-ocp-user}
Expand Down
11 changes: 8 additions & 3 deletions sanitychecks.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

set -euxo pipefail

# The minimum amount of space required for a default installation, expressed in GB
MIN_SPACE_REQUIRED=${MIN_SPACE_REQUIRED:=80}

function verifyWorkingDirIsWorldReadable {
if [ ! -d $WORKING_DIR ]; then
echo "WORKING_DIR ${WORKING_DIR} is not a directory"
Expand All @@ -11,7 +16,7 @@ function verifyWorkingDirIsWorldReadable {
exit 1
fi

if find "${WORKING_DIR}" -maxdepth 0 ! -perm -o=r | grep . ; then
if ! sudo -u nobody test -r ${WORKING_DIR}; then
echo "The WORKING_DIR ${WORKING_DIR} is not world-readable!"
exit 1
fi
Expand All @@ -26,7 +31,7 @@ function verifyFreeSpace {
fi
}

verifyFreeSpace
verifyWorkingDirIsWorldReadable
verifyFreeSpace

echo "Sanity checks passed"
echo "Sanity checks passed"

0 comments on commit 1c90287

Please sign in to comment.