1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00
2007-06-18  Marcus Brinkmann  <marcus@g10code.de>

	* stringhelp.h (percent_escape): New prototype.
	* stringhelp.c (percent_escape): New function.

agent/
2007-06-18  Marcus Brinkmann  <marcus@g10code.de>

	* gpg-agent.c (main): Percent escape pathname in --gpgconf-list
	output.

g10/
2007-06-18  Marcus Brinkmann  <marcus@g10code.de>

	* gpg.c (gpgconf_list): Percent escape output of --gpgconf-list.

scdaemon/
2007-06-18  Marcus Brinkmann  <marcus@g10code.de>

	* scdaemon.c (main): Percent escape output of --gpgconf-list.

sm/
2007-06-18  Marcus Brinkmann  <marcus@g10code.de>

	* gpgsm.c (main): Percent escape output of --gpgconf-list.
This commit is contained in:
Marcus Brinkmann 2007-06-18 20:15:01 +00:00
parent b1b471dcc8
commit e47321829d
11 changed files with 89 additions and 14 deletions

View File

@ -1,3 +1,8 @@
2007-06-18 Marcus Brinkmann <marcus@g10code.de>
* gpg-agent.c (main): Percent escape pathname in --gpgconf-list
output.
2007-06-18 Werner Koch <wk@g10code.com>
* command.c (cmd_killagent) [W32]: New.

View File

@ -693,6 +693,7 @@ main (int argc, char **argv )
if (gpgconf_list)
{
char *filename;
char *filename_esc;
/* List options and default values in the GPG Conf format. */
@ -714,9 +715,12 @@ main (int argc, char **argv )
#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"

View File

@ -1,3 +1,7 @@
2007-06-18 Marcus Brinkmann <marcus@g10code.de>
* gpg.c (gpgconf_list): Percent escape output of --gpgconf-list.
2007-06-14 Werner Koch <wk@g10code.com>
* call-agent.c (start_agent): Use gnupg_module_name.

View File

@ -1456,16 +1456,20 @@ list_config(char *items)
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);
}

View File

@ -1,3 +1,8 @@
2007-06-18 Marcus Brinkmann <marcus@g10code.de>
* stringhelp.h (percent_escape): New prototype.
* stringhelp.c (percent_escape): New function.
2007-06-11 Werner Koch <wk@g10code.com>
* utf8conv.c (jnlib_iconv_open, jnlib_iconv, jnlib_iconv_close): New.
@ -470,7 +475,7 @@ Mon Jan 24 13:04:28 CET 2000 Werner Koch <wk@gnupg.de>
***********************************************************
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

View File

@ -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 @@ memrchr (const void *buffer, int c, size_t n)
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;
}

View File

@ -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 @@ isascii (int c)
#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*/

View File

@ -1,3 +1,7 @@
2007-06-18 Marcus Brinkmann <marcus@g10code.de>
* scdaemon.c (main): Percent escape output of --gpgconf-list.
2007-06-12 Werner Koch <wk@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

View File

@ -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 @@ main (int argc, char **argv )
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,10 +550,13 @@ main (int argc, char **argv )
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"

View File

@ -1,3 +1,7 @@
2007-06-18 Marcus Brinkmann <marcus@g10code.de>
* gpgsm.c (main): Percent escape output of --gpgconf-list.
2007-06-14 Werner Koch <wk@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

View File

@ -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,8 +1393,11 @@ main ( int argc, char **argv)
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"