Bug 34102 - make-certificates.sh#move_cert: counter not reset
make-certificates.sh#move_cert: counter not reset
Status: RESOLVED DUPLICATE of bug 38859
Product: UCS
Classification: Unclassified
Component: SSL
UCS 3.2
All Linux
: P5 minor (vote)
: UCS 3.x
Assigned To: Philipp Hahn
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-11 14:27 CET by Philipp Hahn
Modified: 2016-06-22 13:38 CEST (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2014-02-11 14:27:12 CET
move_cert() can potentially move multiple certificates at once.
Then the counter is not reset for each certificate, leading to holes in the hashed file names.

222 move_cert () {
223 »···local count=0
228 »···for i in "$@"
235 »···»···»···while :
240 »···»···»···»···»···count=$((count + 1))

diff --git a/branches/ucs-3.2/ucs-3.2-0/base/univention-ssl/make-certificates.sh b/branches/ucs-3.2/ucs-3.2-0/base/univention-ssl/make-certificates.sh
index b1a715c..fd0d39c 100755
--- a/branches/ucs-3.2/ucs-3.2-0/base/univention-ssl/make-certificates.sh
+++ b/branches/ucs-3.2/ucs-3.2-0/base/univention-ssl/make-certificates.sh
@@ -220,7 +220,6 @@ EOF
 }
 
 move_cert () {
-       local count=0
        local OPWD=$(pwd)
        cd "$SSLBASE"
 
@@ -232,6 +231,7 @@ move_cert () {
                        local new="${SSLBASE}/${CA}/certs/$(basename "$i")"
                        mv "$i" "$new"
                        local hash=$(openssl x509 -hash -noout -in "$new")
+                       local counter=0
                        while :
                        do
                                local linkname="${CA}/certs/${hash}.${count}"
Comment 1 Philipp Hahn univentionstaff 2016-06-22 13:38:04 CEST
Fixed by r64182

*** This bug has been marked as a duplicate of bug 38859 ***