Poldi bug report: better scdaemon handling

Lionel Elie Mamane lionel at mamane.lu
Thu Jul 30 19:58:43 CEST 2009


 - don't clutter the display with scdaemon stderr

 - use a global configuration file for scdaemon

--- poldi-0.4.1.orig/conf/Makefile.am
+++ poldi-0.4.1/conf/Makefile.am
@@ -33,5 +33,11 @@
 		install -m 644 -T $(top_srcdir)/conf/poldi.conf.skel \
                   $(DESTDIR)$(POLDI_CONF_DIRECTORY)/poldi.conf; \
 	fi
+	if test -e $(DESTDIR)$(POLDI_CONF_DIRECTORY)/scdaemon.conf; then \
+		echo "$(DESTDIR)$(POLDI_CONF_DIRECTORY)/scdaemon.conf exists, doing nothing here"; \
+	else \
+		install -m 644 -T $(top_srcdir)/conf/scdaemon.conf.skel \
+                  $(DESTDIR)$(POLDI_CONF_DIRECTORY)/scdaemon.conf; \
+	fi
 
-EXTRA_DIST = poldi.conf.skel users.skel README.keys
+EXTRA_DIST = poldi.conf.skel users.skel scdaemon.conf.skel README.keys
--- poldi-0.4.1.orig/src/scd/scd.c
+++ poldi-0.4.1/src/scd/scd.c
@@ -326,7 +326,7 @@
 	 fallback: spawn a new scdaemon.  */
 
       const char *pgmname;
-      const char *argv[3];
+      const char *argv[6];
       int no_close_list[3];
       int i;
 
@@ -352,7 +352,13 @@
 
       argv[0] = pgmname;
       argv[1] = "--server";
-      argv[2] = NULL;
+      argv[2] = "--options";
+      argv[3] = "/etc/poldi/scdaemon.conf";
+      if (flags & SCD_FLAG_VERBOSE)
+	argv[4] = "-v";
+      else
+	argv[4] = NULL;
+      argv[5] = NULL;
 
       i=0;
 
@@ -362,7 +368,8 @@
       if (log_get_fd () != -1)
         no_close_list[i++] = log_get_fd ();
 #endif
-      no_close_list[i++] = fileno (stderr);
+      if (flags & SCD_FLAG_VERBOSE)
+	no_close_list[i++] = fileno (stderr);
       no_close_list[i] = -1;
 
       /* connect to the agent and perform initial handshaking */


-- 
Lionel



More information about the Gnupg-devel mailing list