Skip to content

Commit

Permalink
[3/3] etcupdate and mergemaster support for certctl
Browse files Browse the repository at this point in the history
This commit add support for certctl in mergemaster and etcupdate. Both will
either rehash or prompt for rehash as new certificates are
trusted/blacklisted.

This work was done primarily by allanjude@, with minor contributions by
myself.

No objection from:	secteam
Differential Revision:	https://reviews.freebsd.org/D17389
  • Loading branch information
kevans91 committed Oct 2, 2019
1 parent 345af40 commit d88d1b4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions usr.sbin/etcupdate/etcupdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,13 @@ post_install_file()
NEWALIAS_WARN=yes
fi
;;
/usr/share/certs/trusted/*)
/usr/share/certs/blacklisted/*)
log "certctl rehash"
if [ -z "$dryrun" ]; then
env DESTDIR=${DESTDIR} certctl rehash >&3 2>&1
fi
;;
/etc/login.conf)
log "cap_mkdb ${DESTDIR}$1"
if [ -z "$dryrun" ]; then
Expand Down
21 changes: 21 additions & 0 deletions usr.sbin/mergemaster/mergemaster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,10 @@ mm_install () {
/etc/mail/aliases)
NEED_NEWALIASES=yes
;;
/usr/share/certs/trusted/*)
/usr/share/certs/blacklisted/*)
NEED_CERTCTL=yes
;;
/etc/login.conf)
NEED_CAP_MKDB=yes
;;
Expand Down Expand Up @@ -1355,6 +1359,23 @@ case "${NEED_PWD_MKDB}" in
;;
esac

case "${NEED_CERTCTL}" in
'') ;;
*)
echo ''
echo "*** You installed files in /etc/ssl/certs, so make sure that you run"
if [ -n "${DESTDIR}" ]; then
echo " 'env DESTDIR=${DESTDIR} /usr/sbin/certctl rehash'"
echo " to rebuild your certificate authority database"
run_it_now "env DESTDIR=${DESTDIR} /usr/sbin/certctl rehash"
else
echo " '/usr/sbin/certctl rehash'"
echo " to rebuild your certificate authority database"
run_it_now "/usr/sbin/certctl rehash"
fi
;;
esac

if [ -e "${DESTDIR}/etc/localtime" -a ! -L "${DESTDIR}/etc/localtime" -a -z "${PRE_WORLD}" ]; then # Ignore if TZ == UTC
echo ''
[ -n "${DESTDIR}" ] && tzs_args="-C ${DESTDIR}"
Expand Down

0 comments on commit d88d1b4

Please sign in to comment.