- avoid missing or duplicate .pem extension
[packages/ca-certificates.git] / ca-certificates-etc-certs.patch
CommitLineData
70208ba6
JR
1--- ca-certificates/sbin/update-ca-certificates 2008-11-01 18:39:19.000000000 +0100
2+++ ca-certificates/sbin/update-ca-certificates-local 2008-11-01 19:17:39.138384960 +0100
156426d3 3@@ -37,7 +37,7 @@
70208ba6
JR
4
5 CERTSCONF=/etc/ca-certificates.conf
6 CERTSDIR=/usr/share/ca-certificates
156426d3 7-LOCALCERTSDIR=/usr/local/share/ca-certificates
2bf66f1a 8-CERTBUNDLE=ca-certificates.crt
70208ba6 9+LOCALCERTSDIR=/etc/certs
2bf66f1a 10+CERTBUNDLE=/etc/certs/ca-certificates.crt
70208ba6
JR
11 ETCCERTSDIR=/etc/openssl/certs
12 cd $ETCCERTSDIR
2bf66f1a
JR
13@@ -52,7 +52,7 @@
14
15 # Helper files. (Some of them are not simple arrays because we spawn
16 # subshells later on.)
17-TEMPBUNDLE="$(mktemp -t "${CERTBUNDLE}.tmp.XXXXXX")"
18+TEMPBUNDLE="$(mktemp "${CERTBUNDLE}.tmp.XXXXXX")"
19 ADDED="$(mktemp -t "ca-certificates.tmp.XXXXXX")"
20 REMOVED="$(mktemp -t "ca-certificates.tmp.XXXXXX")"
21
156426d3
JR
22@@ -62,7 +62,7 @@
23 # bundle.
24 add() {
25 CERT="$1"
26- PEM="$ETCCERTSDIR/$(basename "$CERT" .crt | sed -e 's/ /_/g' \
d9b817d8 27+ PEM="$ETCCERTSDIR/$(basename "$CERT" .pem | sed -e 's/.crt$/.pem/' -e 's/ /_/g' \
156426d3
JR
28 -e 's/[()]/=/g' \
29 -e 's/,/_/g').pem"
30 if ! test -e "$PEM" || [ "$(readlink "$PEM")" != "$CERT" ]
31@@ -74,7 +74,7 @@
32
33 remove() {
34 CERT="$1"
35- PEM="$ETCCERTSDIR/$(basename "$CERT" .crt).pem"
d9b817d8 36+ PEM="$ETCCERTSDIR/$(basename "$CERT" .pem | sed 's/.crt$/.pem/').pem"
156426d3
JR
37 if test -L "$PEM"
38 then
39 rm -f "$PEM"
f8778b79 40@@ -89,6 +89,7 @@
7477ddf9
JR
41 do
42 case $(readlink $symlink) in
43 $CERTSDIR*) rm -f $symlink;;
44+ $LOCALCERTSDIR*) rm -f $symlink;;
45 esac
46 done
47 find . -type l -print | while read symlink
48@@ -110,24 +110,18 @@
156426d3
JR
49
50 sed -e '/^$/d' -e '/^#/d' -e '/^!/d' $CERTSCONF | while read crt
70208ba6 51 do
156426d3
JR
52- if ! test -f "$CERTSDIR/$crt"
53+ if test -f "$CERTSDIR/$crt"
54 then
55+ add "$CERTSDIR/$crt"
56+ elif test -f "$LOCALCERTSDIR/$crt"
2ce0e3af 57+ then
156426d3
JR
58+ add "$LOCALCERTSDIR/$crt"
59+ else
60- echo "W: $CERTSDIR/$crt not found, but listed in $CERTSCONF." >&2
61+ echo "W: $CERTSDIR/$crt or $LOCALCERTSDIR/$crt not found, but listed in $CERTSCONF." >&2
62 continue
63 fi
64- add "$CERTSDIR/$crt"
65 done
66
67-# Now process certificate authorities installed by the local system
68-# administrator.
69-if [ -d "$LOCALCERTSDIR" ]
70-then
71- find -L "$LOCALCERTSDIR" -type f -name '*.crt' | while read crt
72- do
73- add "$crt"
74- done
75-fi
76-
77 chmod 0644 "$TEMPBUNDLE"
78 mv -f "$TEMPBUNDLE" "$CERTBUNDLE"
79
This page took 0.04757 seconds and 4 git commands to generate.