changeset 483:a055847decbc

merged.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 24 Apr 2014 12:45:11 +0200
parents 0f4331ed4e83 (current diff) 214bf504c54f (diff)
children 5c530b2eb0eb 5834b340c54c
files
diffstat 3 files changed, 22 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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;
         }
     }
--- 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);
 }
 
--- 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);
 

http://wald.intevation.org/projects/trustbridge/