[svn] GnuPG - r4520 - in trunk: agent g10 jnlib scd sm
svn author marcus
cvs at cvs.gnupg.org
Mon Jun 18 22:15:35 CEST 2007
Author: marcus
Date: 2007-06-18 22:15:01 +0200 (Mon, 18 Jun 2007)
New Revision: 4520
Modified:
trunk/agent/ChangeLog
trunk/agent/gpg-agent.c
trunk/g10/ChangeLog
trunk/g10/gpg.c
trunk/jnlib/ChangeLog
trunk/jnlib/stringhelp.c
trunk/jnlib/stringhelp.h
trunk/scd/ChangeLog
trunk/scd/scdaemon.c
trunk/sm/ChangeLog
trunk/sm/gpgsm.c
Log:
jnlib/
2007-06-18 Marcus Brinkmann <marcus at g10code.de>
* stringhelp.h (percent_escape): New prototype.
* stringhelp.c (percent_escape): New function.
agent/
2007-06-18 Marcus Brinkmann <marcus at g10code.de>
* gpg-agent.c (main): Percent escape pathname in --gpgconf-list
output.
g10/
2007-06-18 Marcus Brinkmann <marcus at g10code.de>
* gpg.c (gpgconf_list): Percent escape output of --gpgconf-list.
scdaemon/
2007-06-18 Marcus Brinkmann <marcus at g10code.de>
* scdaemon.c (main): Percent escape output of --gpgconf-list.
sm/
2007-06-18 Marcus Brinkmann <marcus at g10code.de>
* gpgsm.c (main): Percent escape output of --gpgconf-list.
Modified: trunk/agent/ChangeLog
===================================================================
--- trunk/agent/ChangeLog 2007-06-18 20:07:33 UTC (rev 4519)
+++ trunk/agent/ChangeLog 2007-06-18 20:15:01 UTC (rev 4520)
@@ -1,3 +1,8 @@
+2007-06-18 Marcus Brinkmann <marcus at g10code.de>
+
+ * gpg-agent.c (main): Percent escape pathname in --gpgconf-list
+ output.
+
2007-06-18 Werner Koch <wk at g10code.com>
* command.c (cmd_killagent) [W32]: New.
Modified: trunk/agent/gpg-agent.c
===================================================================
--- trunk/agent/gpg-agent.c 2007-06-18 20:07:33 UTC (rev 4519)
+++ trunk/agent/gpg-agent.c 2007-06-18 20:15:01 UTC (rev 4520)
@@ -693,6 +693,7 @@
if (gpgconf_list)
{
char *filename;
+ char *filename_esc;
/* List options and default values in the GPG Conf format. */
@@ -714,9 +715,12 @@
#define GC_OPT_FLAG_NO_ARG_DESC (1UL << 6)
filename = make_filename (opt.homedir, "gpg-agent.conf", NULL );
+ filename_esc = percent_escape (filename);
+
printf ("gpgconf-gpg-agent.conf:%lu:\"%s\n",
- GC_OPT_FLAG_DEFAULT, filename);
+ GC_OPT_FLAG_DEFAULT, filename_esc);
xfree (filename);
+ xfree (filename_esc);
printf ("verbose:%lu:\n"
"quiet:%lu:\n"
Modified: trunk/g10/ChangeLog
===================================================================
--- trunk/g10/ChangeLog 2007-06-18 20:07:33 UTC (rev 4519)
+++ trunk/g10/ChangeLog 2007-06-18 20:15:01 UTC (rev 4520)
@@ -1,3 +1,7 @@
+2007-06-18 Marcus Brinkmann <marcus at g10code.de>
+
+ * gpg.c (gpgconf_list): Percent escape output of --gpgconf-list.
+
2007-06-14 Werner Koch <wk at g10code.com>
* call-agent.c (start_agent): Use gnupg_module_name.
Modified: trunk/g10/gpg.c
===================================================================
--- trunk/g10/gpg.c 2007-06-18 20:07:33 UTC (rev 4519)
+++ trunk/g10/gpg.c 2007-06-18 20:15:01 UTC (rev 4520)
@@ -1456,16 +1456,20 @@
static void
gpgconf_list (const char *configfile)
{
+ char *configfile_esc = percent_escape (configfile);
+
/* The following definitions are taken from gnupg/tools/gpgconf-comp.c. */
#define GC_OPT_FLAG_NONE 0UL
#define GC_OPT_FLAG_DEFAULT (1UL << 4)
printf ("gpgconf-gpg.conf:%lu:\"%s\n",
- GC_OPT_FLAG_DEFAULT,configfile?configfile:"/dev/null");
+ GC_OPT_FLAG_DEFAULT, configfile_esc ? configfile_esc : "/dev/null");
printf ("verbose:%lu:\n", GC_OPT_FLAG_NONE);
printf ("quiet:%lu:\n", GC_OPT_FLAG_NONE);
printf ("keyserver:%lu:\n", GC_OPT_FLAG_NONE);
printf ("reader-port:%lu:\n", GC_OPT_FLAG_NONE);
+
+ xfree (configfile_esc);
}
Modified: trunk/jnlib/ChangeLog
===================================================================
--- trunk/jnlib/ChangeLog 2007-06-18 20:07:33 UTC (rev 4519)
+++ trunk/jnlib/ChangeLog 2007-06-18 20:15:01 UTC (rev 4520)
@@ -1,3 +1,8 @@
+2007-06-18 Marcus Brinkmann <marcus at g10code.de>
+
+ * stringhelp.h (percent_escape): New prototype.
+ * stringhelp.c (percent_escape): New function.
+
2007-06-11 Werner Koch <wk at g10code.com>
* utf8conv.c (jnlib_iconv_open, jnlib_iconv, jnlib_iconv_close): New.
@@ -470,7 +475,7 @@
***********************************************************
Copyright 2000, 2001, 2002, 2003, 2004,
- 2005, 2006 Free Software Foundation, Inc.
+ 2005, 2006, 2007 Free Software Foundation, Inc.
This file is free software; as a special exception the author gives
unlimited permission to copy and/or distribute it, with or without
Modified: trunk/jnlib/stringhelp.c
===================================================================
--- trunk/jnlib/stringhelp.c 2007-06-18 20:07:33 UTC (rev 4519)
+++ trunk/jnlib/stringhelp.c 2007-06-18 20:15:01 UTC (rev 4520)
@@ -1,6 +1,6 @@
/* stringhelp.c - standard string helper functions
* Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005,
- * 2006 Free Software Foundation, Inc.
+ * 2006, 2007 Free Software Foundation, Inc.
*
* This file is part of JNLIB.
*
@@ -825,3 +825,37 @@
return NULL;
}
#endif /*HAVE_MEMRCHR*/
+
+
+/* Percent-escape the string STR by replacing colons with '%3a'. */
+char *
+percent_escape (const char *str)
+{
+ int i = 0;
+ int j = 0;
+ char *ptr;
+
+ if (!str)
+ return NULL;
+
+ while (str[i])
+ if (str[i++] == ':')
+ j++;
+ ptr = jnlib_xmalloc (i + 2 * j + 1);
+ i = 0;
+ while (*str)
+ {
+ if (*str == ':')
+ {
+ ptr[i++] = '%';
+ ptr[i++] = '3';
+ ptr[i++] = 'a';
+ }
+ else
+ ptr[i++] = *str;
+ str++;
+ }
+ ptr[i] = '\0';
+
+ return ptr;
+}
Modified: trunk/jnlib/stringhelp.h
===================================================================
--- trunk/jnlib/stringhelp.h 2007-06-18 20:07:33 UTC (rev 4519)
+++ trunk/jnlib/stringhelp.h 2007-06-18 20:15:01 UTC (rev 4520)
@@ -1,6 +1,6 @@
/* stringhelp.h
* Copyright (C) 1998, 1999, 2000, 2001, 2003,
- * 2006 Free Software Foundation, Inc.
+ * 2006, 2007 Free Software Foundation, Inc.
*
* This file is part of JNLIB.
*
@@ -117,5 +117,8 @@
#endif
#define STR2(v) STR(v)
+/* Percent-escape the string STR by replacing colons with '%3a'. */
+char *percent_escape (const char *str);
+
#endif /*LIBJNLIB_STRINGHELP_H*/
Modified: trunk/scd/ChangeLog
===================================================================
--- trunk/scd/ChangeLog 2007-06-18 20:07:33 UTC (rev 4519)
+++ trunk/scd/ChangeLog 2007-06-18 20:15:01 UTC (rev 4520)
@@ -1,3 +1,7 @@
+2007-06-18 Marcus Brinkmann <marcus at g10code.de>
+
+ * scdaemon.c (main): Percent escape output of --gpgconf-list.
+
2007-06-12 Werner Koch <wk at g10code.com>
* scdaemon.c (main): Replace some calls by init_common_subsystems.
@@ -1635,7 +1639,7 @@
the gpg-agent.
- Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
This file is free software; as a special exception the author gives
unlimited permission to copy and/or distribute it, with or without
Modified: trunk/scd/scdaemon.c
===================================================================
--- trunk/scd/scdaemon.c 2007-06-18 20:07:33 UTC (rev 4519)
+++ trunk/scd/scdaemon.c 2007-06-18 20:15:01 UTC (rev 4520)
@@ -1,5 +1,5 @@
/* scdaemon.c - The GnuPG Smartcard Daemon
- * Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2002, 2004, 2005, 2007 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -530,6 +530,8 @@
if (gpgconf_list)
{
/* List options and default values in the GPG Conf format. */
+ char *filename = NULL;
+ char *filename_esc;
/* The following list is taken from gnupg/tools/gpgconf-comp.c. */
/* Option flags. YOU MUST NOT CHANGE THE NUMBERS OF THE EXISTING
@@ -548,11 +550,14 @@
a default, which is described by the value of the ARGDEF field. */
#define GC_OPT_FLAG_NO_ARG_DESC (1UL << 6)
if (!config_filename)
- config_filename = make_filename (opt.homedir, "scdaemon.conf", NULL );
+ filename = make_filename (opt.homedir, "scdaemon.conf", NULL );
+ filename_esc = percent_escape (filename);
printf ("gpgconf-scdaemon.conf:%lu:\"%s\n",
- GC_OPT_FLAG_DEFAULT, config_filename);
-
+ GC_OPT_FLAG_DEFAULT, filename_esc);
+ xfree (filename_esc);
+ xfree (filename);
+
printf ("verbose:%lu:\n"
"quiet:%lu:\n"
"debug-level:%lu:\"none:\n"
Modified: trunk/sm/ChangeLog
===================================================================
--- trunk/sm/ChangeLog 2007-06-18 20:07:33 UTC (rev 4519)
+++ trunk/sm/ChangeLog 2007-06-18 20:15:01 UTC (rev 4520)
@@ -1,3 +1,7 @@
+2007-06-18 Marcus Brinkmann <marcus at g10code.de>
+
+ * gpgsm.c (main): Percent escape output of --gpgconf-list.
+
2007-06-14 Werner Koch <wk at g10code.com>
* call-agent.c (start_agent): Use gnupg_module_name.
@@ -1931,7 +1935,7 @@
Copyright 2001, 2002, 2003, 2004, 2005,
- 2006 Free Software Foundation, Inc.
+ 2006, 2007 Free Software Foundation, Inc.
This file is free software; as a special exception the author gives
unlimited permission to copy and/or distribute it, with or without
Modified: trunk/sm/gpgsm.c
===================================================================
--- trunk/sm/gpgsm.c 2007-06-18 20:07:33 UTC (rev 4519)
+++ trunk/sm/gpgsm.c 2007-06-18 20:15:01 UTC (rev 4520)
@@ -1,6 +1,6 @@
/* gpgsm.c - GnuPG for S/MIME
* Copyright (C) 2001, 2002, 2003, 2004, 2005,
- * 2006 Free Software Foundation, Inc.
+ * 2006, 2007 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -1393,9 +1393,12 @@
a default, which is described by the value of the ARGDEF field. */
#define GC_OPT_FLAG_NO_ARG_DESC (1UL << 6)
+ char *config_filename_esc = percent_escape (opt.config_filename);
+
printf ("gpgconf-gpgsm.conf:%lu:\"%s\n",
- GC_OPT_FLAG_DEFAULT, opt.config_filename);
-
+ GC_OPT_FLAG_DEFAULT, config_filename_esc);
+ xfree (config_filename_esc);
+
printf ("verbose:%lu:\n"
"quiet:%lu:\n"
"debug-level:%lu:\"none:\n"
More information about the Gnupg-commits
mailing list