mirror of
https://github.com/StackExchange/blackbox.git
synced 2025-12-16 11:33:01 +02:00
More securely quote $BB_FILES
This commit is contained in:
@@ -46,6 +46,8 @@ if $SECRETSEXPOSED ; then
|
|||||||
COMMIT_FILES="$BB_FILES $encrypted_file $unencrypted_file"
|
COMMIT_FILES="$BB_FILES $encrypted_file $unencrypted_file"
|
||||||
else
|
else
|
||||||
COMMIT_FILES="$BB_FILES $encrypted_file"
|
COMMIT_FILES="$BB_FILES $encrypted_file"
|
||||||
|
# FIXME(tal): This should be an array so that filenames with
|
||||||
|
# spaces aren't a problem.
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# TODO(tlim): This should be moved to _blackbox_common.sh in a
|
# TODO(tlim): This should be moved to _blackbox_common.sh in a
|
||||||
@@ -61,7 +63,7 @@ if [[ $VCS_TYPE = 'git' ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo 'NOTE: "already tracked!" messages are safe to ignore.'
|
echo 'NOTE: "already tracked!" messages are safe to ignore.'
|
||||||
vcs_add $BB_FILES $encrypted_file
|
vcs_add "$BB_FILES" $encrypted_file
|
||||||
vcs_commit "registered in blackbox: ${unencrypted_file}" $COMMIT_FILES
|
vcs_commit "registered in blackbox: ${unencrypted_file}" $COMMIT_FILES
|
||||||
echo "========== UPDATING VCS: DONE"
|
echo "========== UPDATING VCS: DONE"
|
||||||
echo "Local repo updated. Please push when ready."
|
echo "Local repo updated. Please push when ready."
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ source ${blackbox_home}/_blackbox_common.sh
|
|||||||
change_to_root
|
change_to_root
|
||||||
|
|
||||||
echo '========== FILES BEING SHREDDED:'
|
echo '========== FILES BEING SHREDDED:'
|
||||||
for i in $(<$BB_FILES) ; do
|
for i in $(<"$BB_FILES") ; do
|
||||||
unencrypted_file=$(get_unencrypted_filename "$i")
|
unencrypted_file=$(get_unencrypted_filename "$i")
|
||||||
encrypted_file=$(get_encrypted_filename "$i")
|
encrypted_file=$(get_encrypted_filename "$i")
|
||||||
if [[ -f "$unencrypted_file" ]]; then
|
if [[ -f "$unencrypted_file" ]]; then
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ awk <"$BB_FILES" '{ print " " $1 ".gpg" }'
|
|||||||
|
|
||||||
echo '========== FILES IN THE WAY:'
|
echo '========== FILES IN THE WAY:'
|
||||||
need_warning=false
|
need_warning=false
|
||||||
for i in $(<$BB_FILES) ; do
|
for i in $(<"$BB_FILES") ; do
|
||||||
unencrypted_file=$(get_unencrypted_filename "$i")
|
unencrypted_file=$(get_unencrypted_filename "$i")
|
||||||
encrypted_file=$(get_encrypted_filename "$i")
|
encrypted_file=$(get_encrypted_filename "$i")
|
||||||
if [[ -f "$unencrypted_file" ]]; then
|
if [[ -f "$unencrypted_file" ]]; then
|
||||||
@@ -40,7 +40,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo '========== RE-ENCRYPTING FILES:'
|
echo '========== RE-ENCRYPTING FILES:'
|
||||||
for i in $(<$BB_FILES) ; do
|
for i in $(<"$BB_FILES") ; do
|
||||||
unencrypted_file=$(get_unencrypted_filename "$i")
|
unencrypted_file=$(get_unencrypted_filename "$i")
|
||||||
encrypted_file=$(get_encrypted_filename "$i")
|
encrypted_file=$(get_encrypted_filename "$i")
|
||||||
echo ========== PROCESSING "$unencrypted_file"
|
echo ========== PROCESSING "$unencrypted_file"
|
||||||
@@ -53,7 +53,7 @@ done
|
|||||||
fail_if_keychain_has_secrets
|
fail_if_keychain_has_secrets
|
||||||
|
|
||||||
echo '========== COMMITING TO VCS:'
|
echo '========== COMMITING TO VCS:'
|
||||||
vcs_commit 'Re-encrypted keys' $(awk <$BB_FILES '{ print $1 ".gpg" }' )
|
vcs_commit 'Re-encrypted keys' $(awk <"$BB_FILES" '{ print $1 ".gpg" }' )
|
||||||
|
|
||||||
VCSCMD=$(which_vcs)
|
VCSCMD=$(which_vcs)
|
||||||
echo '========== DONE.'
|
echo '========== DONE.'
|
||||||
|
|||||||
Reference in New Issue
Block a user