Author: kevans
Date: Tue Sep 15 17:13:29 2020
New Revision: 365756
URL: https://svnweb.freebsd.org/changeset/base/365756

Log:
  certctl: fix unprivileged mode
  
  The first issue was lack of quoting around INSTALLFLAGS, which set it
  incorrectly and produced an error on -M.
  
  The second issue was that we weren't actually doing the install in
  unprivileged mode, making it effectively useless. This was designed to pass
  through the proper metalog/unpriv flags to install(1), so just let it
  happen.
  
  MFC after:    3 days

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

Modified: head/usr.sbin/certctl/certctl.sh
==============================================================================
--- head/usr.sbin/certctl/certctl.sh    Tue Sep 15 16:41:21 2020        
(r365755)
+++ head/usr.sbin/certctl/certctl.sh    Tue Sep 15 17:13:29 2020        
(r365756)
@@ -129,7 +129,7 @@ do_scan()
                [ -d "$CPATH" ] || continue
                echo "Scanning $CPATH for certificates..."
                for CFILE in $(ls -1 "${CPATH}" | grep -Ee "${FILEPAT}"); do
-                       [ -e "$CPATH/$CFILE" -a $UNPRIV -eq 0 ] || continue
+                       [ -e "$CPATH/$CFILE" ] || continue
                        [ $VERBOSE -gt 0 ] && echo "Reading $CFILE"
                        "$CFUNC" "$CPATH/$CFILE"
                done
@@ -263,7 +263,7 @@ shift $(( $OPTIND - 1 ))
 
 : ${METALOG:=${DESTDIR}/METALOG}
 INSTALLFLAGS=
-[ $UNPRIV -eq 1 ] && INSTALLFLAGS=-U -M ${METALOG} -D ${DESTDIR}
+[ $UNPRIV -eq 1 ] && INSTALLFLAGS="-U -M ${METALOG} -D ${DESTDIR}"
 : 
${TRUSTPATH:=${DESTDIR}/usr/share/certs/trusted:${DESTDIR}/usr/local/share/certs:${DESTDIR}/usr/local/etc/ssl/certs}
 : 
${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted}
 : ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs}
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to