bkctld-check-incs: Protect jail_config_epoch
Test if `incs_policy_file` exists before using it. Fixes #43.
This commit is contained in:
parent
68a7da6b88
commit
c2353b03a5
|
@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
### Fixed
|
||||
|
||||
* bkctld-check-incs: Protect `jail_config_epoch`
|
||||
|
||||
### Security
|
||||
|
||||
## [2.8.0] - 2020-11-28
|
||||
|
|
|
@ -20,10 +20,10 @@ for jail_name in $("${LIBDIR}/bkctld-list"); do
|
|||
# Today in ISO format
|
||||
today_iso=$(date +"%Y-%m-%d")
|
||||
|
||||
if [ -n "${incs_policy_file}" ]; then
|
||||
# get jail last configuration date
|
||||
jail_config_epoch=$(date --date "$(stat -c %y ${incs_policy_file})" +"%s")
|
||||
|
||||
if [ -n "${incs_policy_file}" ]; then
|
||||
# loop for each line in jail configuration
|
||||
for line in $(cat ${incs_policy_file}); do
|
||||
# inc date in ISO format
|
||||
|
|
Loading…
Reference in a new issue