Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 May 2020 03:30:28 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r361023 - head/usr.sbin/certctl
Message-ID:  <202005140330.04E3USMB050538@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Thu May 14 03:30:27 2020
New Revision: 361023
URL: https://svnweb.freebsd.org/changeset/base/361023

Log:
  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

Modified:
  head/usr.sbin/certctl/certctl.sh

Modified: head/usr.sbin/certctl/certctl.sh
==============================================================================
--- head/usr.sbin/certctl/certctl.sh	Thu May 14 03:25:12 2020	(r361022)
+++ head/usr.sbin/certctl/certctl.sh	Thu May 14 03:30:27 2020	(r361023)
@@ -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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005140330.04E3USMB050538>