diff cinst/main.c @ 302:fac7e1b0e558

Add nss store calling function and use it in cinst
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 03 Apr 2014 14:28:23 +0200
parents ccb00bf48b75
children f17226aa2e09
line wrap: on
line diff
--- a/cinst/main.c	Thu Apr 03 14:26:43 2014 +0200
+++ b/cinst/main.c	Thu Apr 03 14:28:23 2014 +0200
@@ -40,6 +40,7 @@
 #include "logging.h"
 #include "errorcodes.h"
 #include "windowsstore.h"
+#include "nssstore.h"
 
 /* The certificate list + instructions may only be so long as
  * twice the accepted certificatelist size */
@@ -200,11 +201,6 @@
   list_status_t list_status;
   bool do_uninstall = false;
 
-  for (ret = 0; ret < argc; ret++)
-    {
-      printf("Arg %i : %s \n", ret, argv[ret]);
-    }
-
   /* Some very static argument parsing. list= and instructions= is only
      added to make it more transparent how this programm is called if
      a user looks at the detailed uac dialog. */
@@ -260,11 +256,14 @@
   if (do_uninstall)
     {
 #ifdef WIN32
-      return write_stores_win (NULL, all_valid_certs);
-#else
-    /*TODO*/
-      return 0;
+      ret = write_stores_win (NULL, all_valid_certs);
+      if (ret != 0)
+        {
+          ERRORPRINTF ("Failed to write windows stores retval: %i\n", ret);
+        }
 #endif
+      ret = write_stores_nss (NULL, all_valid_certs);
+      return ret;
     }
 
   ret = read_instructions_file (instruction_file_name, &to_install,
@@ -300,8 +299,18 @@
     }
 
 #ifdef WIN32
-  return write_stores_win (to_install, to_remove);
+  ret = write_stores_win (to_install, to_remove);
+  if (ret != 0)
+    {
+      ERRORPRINTF ("Failed to write windows stores retval: %i\n", ret);
+    }
 #endif
+  ret = write_stores_nss (to_install, to_remove);
+
+  if (ret != 0)
+    {
+      ERRORPRINTF ("Failed to write nss stores");
+    }
 
   /* Make valgrind happy */
   strv_free (to_install);

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