summaryrefslogtreecommitdiff
path: root/sbin/update-ca-certificates
diff options
context:
space:
mode:
authorMichael Shuler <michael@pbandjelly.org>2021-10-16 18:09:15 +0200
committerJulien Cristau <jcristau@debian.org>2021-10-16 18:09:15 +0200
commitddcda60b9467d0369487cf6e7338bdcff946b51e (patch)
tree4ea413a29d719c61b1f1d30350fcade3b798498b /sbin/update-ca-certificates
parent9ce684d0d09e980c61b46ee3b3fcedd02c6ef8cc (diff)
downloadca-certificates-ddcda60b9467d0369487cf6e7338bdcff946b51e.tar.gz
Fix error on install when TEMPBUNDLE missing. Closes: #996005
[jcristau: also make the restorecon call conditional]
Diffstat (limited to 'sbin/update-ca-certificates')
-rwxr-xr-xsbin/update-ca-certificates12
1 files changed, 8 insertions, 4 deletions
diff --git a/sbin/update-ca-certificates b/sbin/update-ca-certificates
index 789867f..9a876d7 100755
--- a/sbin/update-ca-certificates
+++ b/sbin/update-ca-certificates
@@ -187,10 +187,14 @@ then
fi
fi
-chmod 0644 "$TEMPBUNDLE"
-mv -f "$TEMPBUNDLE" "$CERTBUNDLE"
-# Restore proper SELinux label after moving the file
-[ -x /sbin/restorecon ] && /sbin/restorecon "$CERTBUNDLE" >/dev/null 2>&1
+# chmod and mv only if TEMPBUNDLE exists or install may fail, #996005
+if [ -f "$TEMPBUNDLE" ]
+then
+ chmod 0644 "$TEMPBUNDLE"
+ mv -f "$TEMPBUNDLE" "$CERTBUNDLE"
+ # Restore proper SELinux label after moving the file
+ [ -x /sbin/restorecon ] && /sbin/restorecon "$CERTBUNDLE" >/dev/null 2>&1
+fi
echo "$ADDED_CNT added, $REMOVED_CNT removed; done."