pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/42238: security/mozilla-rootcerts does not work with nawk



>Number:         42238
>Category:       pkg
>Synopsis:       security/mozilla-rootcerts does not work with nawk
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 27 14:25:00 +0000 2009
>Originator:     leo%marco.de@localhost
>Release:        NetBSD 5.0_STABLE
>Organization:
Matthias Pfaller                            Software Entwicklung
marco Systemanalyse und Entwicklung GmbH    Tel   +49 8131 5161 41
Hans-Böckler-Str. 2, D 85221 Dachau         Fax   +49 8131 5161 66
http://www.marco.de/                        Email leo%marco.de@localhost
>Environment:
        
        
System: NetBSD zork 5.0_STABLE NetBSD 5.0_STABLE (ZORK) #15: Wed Sep 30 
09:10:09 CEST 2009 leo@slug:/usr/src-5.0/sys/arch/i386/compile/ZORK i386
Architecture: i386
Machine: i386
>Description:
        pkgsrc/security/mozilla-rootcerts does not work for me on
        netbsd-5.0. It looks like awk does not like printing strings with
        embedded \0.
>How-To-Repeat:
        install pkgsrc/security/mozilla-rootcerts. Do a 
        "mozilla-rootcerts extract" and watch it fail.
>Fix:
        Apply the following patch.
--- mozilla-rootcerts.sh        2007-09-20 22:02:53.000000000 +0200
+++ /tmp/xxx/mozilla-rootcerts  2009-10-27 15:05:47.000000000 +0100
@@ -126,13 +126,6 @@
        # "mozilla-rootcert-<n>.pem" in the current working directory.
        #
        cat "$certfile" | ${AWK} -v OPENSSL=${OPENSSL} '
-       function join(array, start, end, separator,     result, i) {
-               result = array[start]
-               for (i = start + 1; i <= end; i++)
-                       result = result separator array[i]
-               return result
-       }
-
        function base8to10(o,   octal, decimal, power, i, n) {
                decimal = 0
                n = split(o, octal, "")
@@ -149,7 +142,6 @@
        BEGIN {
                filenum = 0
                while (getline) {
-                       D = 0
                        if ($0 !~ /^CKA_VALUE MULTILINE_OCTAL/) continue
 
                        filename = "mozilla-rootcert-" filenum ".pem"
@@ -160,10 +152,9 @@
                                if ($0 ~ /^END/) break
                                n = split($0, line, "\\")
                                for (i = 2; i <= n; i++) {
-                                       der[D++] = sprintf("%c", 
base8to10(line[i]))
+                                       printf("%c",  base8to10(line[i])) | cmd
                                }
                        }
-                       printf("%s", join(der, 0, D, "")) | cmd
                        close(cmd)
                }
        }'
        

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index