From 946966d161b544be71f482f1441ca9dc7390fd84 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Wed, 19 Feb 2020 02:34:56 +0000 Subject: [PATCH] certctl(8): switch to install(1) to fix DESTDIR support "Oops" - ln(1) is fine and dandy, but when you're using DESTDIR...it's not- the path will almost certainly be invalid once the root you've just installed to is relocated, perhaps to /. Switch to install(1) using `-l rs` to calculate the relative symlink between the two, which should work just fine in all cases. MFC after: 1 week --- usr.sbin/certctl/certctl.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/certctl/certctl.sh b/usr.sbin/certctl/certctl.sh index 004da292381a..b46d3371db16 100755 --- a/usr.sbin/certctl/certctl.sh +++ b/usr.sbin/certctl/certctl.sh @@ -69,7 +69,7 @@ create_trusted_link() return 1 fi [ $VERBOSE -gt 0 ] && echo "Adding $hash.0 to trust store" - [ $NOOP -eq 0 ] && ln -fs $(realpath "$1") "$CERTDESTDIR/$hash.0" + [ $NOOP -eq 0 ] && install -lrs $(realpath "$1") "$CERTDESTDIR/$hash.0" } create_blacklisted() @@ -88,7 +88,7 @@ create_blacklisted() return fi [ $VERBOSE -gt 0 ] && echo "Adding $filename to blacklist" - [ $NOOP -eq 0 ] && ln -fs "$srcfile" "$BLACKLISTDESTDIR/$filename" + [ $NOOP -eq 0 ] && install -lrs "$srcfile" "$BLACKLISTDESTDIR/$filename" } do_scan()