Skip to content

Commit

Permalink
Prevent code updates if malicious changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-m committed May 25, 2017
1 parent 46251bb commit 093c71f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
19 changes: 19 additions & 0 deletions startup.d/10-git-pull.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
#!/bin/sh

# Prepare code auditing environment
REPO_URL=$(git remote get-url origin)
TEST_DIR=$(mktemp -d)
git clone "$REPO_URL" "$TEST_DIR";
pushd "$TEST_DIR";

# Code auditing section
python -m py_compile $(find . -name '*.py');
if [ "$?" != "0" ]
then
echo "There is syntax error. This may endanger chaos. Pauses updates."
exit 45
fi

# End code auditing section
popd

git checkout master
git pull
8 changes: 0 additions & 8 deletions startup.d/20-syntax-check.sh

This file was deleted.

0 comments on commit 093c71f

Please # to comment.