X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fssl%2Ffiles%2Fupdate-ca-certificates-dsa;h=2f1dce88ceaa0fed0ebafd0bd7b3d4406c83a73c;hb=fcd178e69f31c2bb35f10b6608b8799a69297f1d;hp=b6d35a1f350b7d8e448363554fe949be05d758e0;hpb=5ea69733aab993c0fe3f2cf731f2d7a3c0328939;p=mirror%2Fdsa-puppet.git diff --git a/modules/ssl/files/update-ca-certificates-dsa b/modules/ssl/files/update-ca-certificates-dsa index b6d35a1f3..2f1dce88c 100755 --- a/modules/ssl/files/update-ca-certificates-dsa +++ b/modules/ssl/files/update-ca-certificates-dsa @@ -1,6 +1,6 @@ #!/bin/sh -e -# This is a copy of update-ca-certificates from the ca-certificates package in jessie -# with patches applied to allow custom paths and to allow setting to default certs: +# This is a copy of update-ca-certificates from the ca-certificates package in stretch +# It allows custom paths and setting to default certs: # https://bugs.debian.org/774059 # https://bugs.debian.org/774201 # @@ -8,7 +8,7 @@ # # Copyright (c) 2003 Fumitoshi UKAI # Copyright (c) 2009 Philipp Kern -# +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -99,7 +99,7 @@ add() { if ! test -e "$PEM" || [ "$(readlink "$PEM")" != "$CERT" ] then ln -sf "$CERT" "$PEM" - echo +$PEM >> "$ADDED" + echo "+$PEM" >> "$ADDED" fi # Add trailing newline to certificate, if it is missing (#635570) sed -e '$a\' "$CERT" >> "$TEMPBUNDLE" @@ -111,27 +111,27 @@ remove() { if test -L "$PEM" then rm -f "$PEM" - echo -$PEM >> "$REMOVED" + echo "-$PEM" >> "$REMOVED" fi } -cd $ETCCERTSDIR +cd "$ETCCERTSDIR" if [ "$fresh" = 1 ]; then - echo -n "Clearing symlinks in $ETCCERTSDIR..." + echo "Clearing symlinks in $ETCCERTSDIR..." find . -type l -print | while read symlink do - case $(readlink $symlink) in - $CERTSDIR*) rm -f $symlink;; + case $(readlink "$symlink") in + $CERTSDIR*|$LOCALCERTSDIR*) rm -f $symlink;; esac done find . -type l -print | while read symlink do - test -f $symlink || rm -f $symlink + test -f "$symlink" || rm -f "$symlink" done echo "done." fi -echo -n "Updating certificates in $ETCCERTSDIR... " +echo "Updating certificates in $ETCCERTSDIR..." # Add default certificate authorities if requested if [ "$default" = 1 ]; then @@ -143,12 +143,12 @@ fi # Handle certificates that should be removed. This is an explicit act # by prefixing lines in the configuration files with exclamation marks (!). -sed -n -e '/^$/d' -e 's/^!//p' $CERTSCONF | while read crt +sed -n -e '/^$/d' -e 's/^!//p' "$CERTSCONF" | while read crt do remove "$CERTSDIR/$crt" done -sed -e '/^$/d' -e '/^#/d' -e '/^!/d' $CERTSCONF | while read crt +sed -e '/^$/d' -e '/^#/d' -e '/^!/d' "$CERTSCONF" | while read crt do if ! test -f "$CERTSDIR/$crt" then @@ -194,17 +194,16 @@ echo "$ADDED_CNT added, $REMOVED_CNT removed; done." if [ -d "$HOOKSDIR" ] then -echo -n "Running hooks in $HOOKSDIR...." -VERBOSE_ARG= -[ "$verbose" = 0 ] || VERBOSE_ARG=--verbose -eval run-parts $VERBOSE_ARG --test -- $HOOKSDIR | while read hook -do - ( cat $ADDED - cat $REMOVED ) | $hook || echo E: $hook exited with code $?. -done -echo "done." + echo "Running hooks in $HOOKSDIR..." + VERBOSE_ARG= + [ "$verbose" = 0 ] || VERBOSE_ARG="--verbose" + eval run-parts "$VERBOSE_ARG" --test -- "$HOOKSDIR" | while read hook + do + ( cat "$ADDED" + cat "$REMOVED" ) | "$hook" || echo "E: $hook exited with code $?." + done + echo "done." fi # vim:set et sw=2: -