Check on $USER was always true

This commit is contained in:
Jérémy Lecour 2020-05-04 17:42:01 +02:00 committed by Jérémy Lecour
parent 2e6c4f541f
commit 536de976cc
2 changed files with 5 additions and 1 deletions

View file

@ -18,4 +18,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
* Check on $USER was always true
### Security

View file

@ -485,7 +485,9 @@ main() {
PKIUSER="shellpki"
fi
[ "${USER}" != "root" ] || [ "${USER}" != "${PKIUSER}" ] || error "Please become root before running ${0} !"
if [ "${USER}" != "root" ] && [ "${USER}" != "${PKIUSER}" ]; then
error "Please become root before running ${0} !"
fi
# retrieve CA path from config file
CADIR=$(grep -E "^dir" "${CONFFILE}" | cut -d'=' -f2|xargs -n1)