summaryrefslogtreecommitdiff
path: root/usr.sbin/certctl
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2020-05-14 03:30:27 +0000
committerKyle Evans <kevans@FreeBSD.org>2020-05-14 03:30:27 +0000
commit5e6c628e4f95639974b7fc882b993083e323e7ee (patch)
tree4bde854b4ad0b4016d5198d2d7081c6b999120da /usr.sbin/certctl
parentbb33c910776d908cd459d19959beefffed85d514 (diff)
downloadsrc-test-5e6c628e4f95639974b7fc882b993083e323e7ee.tar.gz
src-test-5e6c628e4f95639974b7fc882b993083e323e7ee.zip
certctl: follow-up to r361022, prune blacklist as well
Otherwise, removals from the blacklist may not get processed as they should. While we're here, restructure these to not bother with mkdir(1) if we've already tested them to exist. MFC after: 3 days
Notes
Notes: svn path=/head/; revision=361023
Diffstat (limited to 'usr.sbin/certctl')
-rwxr-xr-xusr.sbin/certctl/certctl.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/usr.sbin/certctl/certctl.sh b/usr.sbin/certctl/certctl.sh
index 8212305ac67cf..ec7e601a47ae8 100755
--- a/usr.sbin/certctl/certctl.sh
+++ b/usr.sbin/certctl/certctl.sh
@@ -143,9 +143,16 @@ cmd_rehash()
{
if [ $NOOP -eq 0 ]; then
- [ -e "$CERTDESTDIR" ] && find "$CERTDESTDIR" -type link -delete
- mkdir -p "$CERTDESTDIR"
- mkdir -p "$BLACKLISTDESTDIR"
+ if [ -e "$CERTDESTDIR" ]; then
+ find "$CERTDESTDIR" -type link -delete
+ else
+ mkdir -p "$CERTDESTDIR"
+ fi
+ if [ -e "$BLACKLISTDESTDIR" ]; then
+ find "$BLACKLISTDESTDIR" -type link -delete
+ else
+ mkdir -p "$BLACKLISTDESTDIR"
+ fi
fi
do_scan create_blacklisted "$BLACKLISTPATH"