[PATCH 5 of 5] merged

Wald Commits scm-commit at wald.intevation.org
Thu Apr 24 12:45:23 CEST 2014


# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1398336311 -7200
# Node ID a055847decbc9a7e81f7a0d5de30554e2f4f9235
# Parent  0f4331ed4e83702a468f388d6ec41192ec8aedc7
# Parent  214bf504c54f9dd00dfd9c18c80c62f62955d5b5
merged.

diff -r 0f4331ed4e83 -r a055847decbc cinst/nssstore_linux.c
--- a/cinst/nssstore_linux.c	Thu Apr 24 12:44:35 2014 +0200
+++ b/cinst/nssstore_linux.c	Thu Apr 24 12:45:11 2014 +0200
@@ -66,6 +66,7 @@
   path_len = strlen (buf);
   retval = xmalloc (path_len + 1);
   strncpy (retval, buf, path_len);
+  retval[path_len] = '\0';
 
   return retval;
 }
@@ -188,7 +189,14 @@
     {
       if (fprintf (stream, "I:%s\n", to_install[i]) <= 3)
         {
-          ERRORPRINTF ("Write failed: %s \n", strerror(errno));
+          int err = errno;
+          ERRORPRINTF ("Write failed: %s \n", strerror(err));
+          if (err == 32)
+            {
+              /* Broken pipe is expected if there are no NSS stores
+                 to be found the process just exits. That's ok */
+              success = true;
+            }
           goto done;
         }
     }
@@ -197,7 +205,14 @@
     {
       if (fprintf (stream, "R:%s\n", to_remove[i]) <= 3)
         {
-          ERRORPRINTF ("Write failed: %s \n", strerror(errno));
+          int err = errno;
+          ERRORPRINTF ("Write failed: %s \n", strerror(err));
+          if (err == 32)
+            {
+              /* Broken pipe is expected if there are no NSS stores
+                 to be found the process just exits. That's ok */
+              success = true;
+            }
           goto done;
         }
     }
diff -r 0f4331ed4e83 -r a055847decbc ui/sslhelp.cpp
--- a/ui/sslhelp.cpp	Thu Apr 24 12:44:35 2014 +0200
+++ b/ui/sslhelp.cpp	Thu Apr 24 12:45:11 2014 +0200
@@ -18,7 +18,7 @@
 {
     char errbuf[1020];
     polarssl_strerror(ret, errbuf, 1020);
-    errbuf[1020] = '\0'; /* Just to be sure */
+    errbuf[1019] = '\0'; /* Just to be sure */
     return QString::fromLatin1(errbuf);
 }
 
diff -r 0f4331ed4e83 -r a055847decbc ui/tests/nsstest.cpp
--- a/ui/tests/nsstest.cpp	Thu Apr 24 12:44:35 2014 +0200
+++ b/ui/tests/nsstest.cpp	Thu Apr 24 12:45:11 2014 +0200
@@ -170,10 +170,14 @@
         QVERIFY(instList.size() > 2);
         strv_append (&to_remove, to_install[1], qstrlen(to_install[1]));
 
+        QList<QByteArray> beforeFF = get_nss_certs(&ffNSSDir);
+        QVERIFY(strv_length(to_remove) == 1);
         QVERIFY(write_stores_nss(NULL, to_remove) == 0);
 
         QList<QByteArray> installedCertsFF = get_nss_certs(&ffNSSDir);
         QList<QByteArray> installedCertsTB = get_nss_certs(&tbNSSDir);
+        QVERIFY(beforeFF.size() > 0);
+        QVERIFY(beforeFF.size() - 1 == installedCertsFF.size());
 
         QVERIFY(installedCertsFF == installedCertsTB);
 


More information about the Trustbridge-commits mailing list