Skip to content

Commit

Permalink
kamctl: fix dangerous 'rm -rf' code in case if variables are not defined
Browse files Browse the repository at this point in the history
(cherry picked from commit 62f573d)
  • Loading branch information
taurus-forever authored and miconda committed Aug 30, 2017
1 parent e86b803 commit 0a5b94d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/kamctl/kamctl
Expand Up @@ -2614,7 +2614,7 @@ tls_ca() {
merr "Failed to create root directory $CA_PATH"
exit 1
fi
rm -fr $CA_PATH/*
rm -fr "${CA_PATH:?}"/*
mkdir $CA_PATH/private
mkdir $CA_PATH/certs
touch $CA_PATH/index.txt
Expand Down Expand Up @@ -2685,7 +2685,7 @@ tls_ca() {
merr "Failed to create user directory $USER_DIR "
exit 1
fi
rm -fr $USER_DIR/*
rm -fr "${USER_DIR:?}"/*

mecho "Creating user certificate request"
openssl req -config $USER_CFG -out $USER_DIR/$USER-cert_req.pem \
Expand Down

0 comments on commit 0a5b94d

Please sign in to comment.