mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-02 12:01:32 +01:00
* gpgsm.c: New option --agent-program
* call-agent.c (start_agent): Allow to override the default path to the agent.
This commit is contained in:
parent
99829ef5fb
commit
d9aecd9eb7
@ -1,5 +1,9 @@
|
|||||||
2001-11-26 Werner Koch <wk@gnupg.org>
|
2001-11-26 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* gpgsm.c: New option --agent-program
|
||||||
|
* call-agent.c (start_agent): Allow to override the default path
|
||||||
|
to the agent.
|
||||||
|
|
||||||
* keydb.c (keydb_add_resource): Create keybox
|
* keydb.c (keydb_add_resource): Create keybox
|
||||||
|
|
||||||
* keylist.c (gpgsm_list_keys): Fixed non-server keylisting.
|
* keylist.c (gpgsm_list_keys): Fixed non-server keylisting.
|
||||||
|
@ -335,8 +335,9 @@ start_agent (void)
|
|||||||
if (!pid)
|
if (!pid)
|
||||||
{ /* child */
|
{ /* child */
|
||||||
int i, n;
|
int i, n;
|
||||||
char errbuf[100];
|
char errbuf[512];
|
||||||
int log_fd = log_get_fd ();
|
int log_fd = log_get_fd ();
|
||||||
|
const char *pgmname;
|
||||||
|
|
||||||
/* close all files which will not be duped but keep stderr
|
/* close all files which will not be duped but keep stderr
|
||||||
and log_stream for now */
|
and log_stream for now */
|
||||||
@ -371,10 +372,17 @@ start_agent (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* and start it */
|
/* and start it */
|
||||||
execl ("../agent/gpg-agent", "gpg-agent", "--server", NULL);
|
if (!opt.agent_program || !*opt.agent_program)
|
||||||
|
opt.agent_program = "../agent/gpg-agent";
|
||||||
|
if ( !(pgmname = strrchr (opt.agent_program, '/')))
|
||||||
|
pgmname = opt.agent_program;
|
||||||
|
else
|
||||||
|
pgmname++;
|
||||||
|
execl (opt.agent_program, pgmname, "--server", NULL);
|
||||||
/* oops - tell the parent about it */
|
/* oops - tell the parent about it */
|
||||||
snprintf (errbuf, DIM(errbuf)-1, "ERR %d execl failed: %.50s\n",
|
snprintf (errbuf, DIM(errbuf)-1, "ERR %d can't exec `%s': %.50s\n",
|
||||||
ASSUAN_Problem_Starting_Server, strerror (errno));
|
ASSUAN_Problem_Starting_Server, opt.agent_program,
|
||||||
|
strerror (errno));
|
||||||
errbuf[DIM(errbuf)-1] = 0;
|
errbuf[DIM(errbuf)-1] = 0;
|
||||||
writen (1, errbuf, strlen (errbuf));
|
writen (1, errbuf, strlen (errbuf));
|
||||||
_exit (4);
|
_exit (4);
|
||||||
|
@ -77,7 +77,7 @@ enum cmd_and_opt_values {
|
|||||||
aServer,
|
aServer,
|
||||||
|
|
||||||
oEnableSpecialFilenames,
|
oEnableSpecialFilenames,
|
||||||
|
oAgentProgram,
|
||||||
|
|
||||||
oTextmode,
|
oTextmode,
|
||||||
oFingerprint,
|
oFingerprint,
|
||||||
@ -279,6 +279,8 @@ static ARGPARSE_OPTS opts[] = {
|
|||||||
{ oNoGreeting, "no-greeting", 0, "@" },
|
{ oNoGreeting, "no-greeting", 0, "@" },
|
||||||
{ oNoOptions, "no-options", 0, "@" }, /* shortcut for --options /dev/null */
|
{ oNoOptions, "no-options", 0, "@" }, /* shortcut for --options /dev/null */
|
||||||
{ oHomedir, "homedir", 2, "@" }, /* defaults to "~/.gnupg" */
|
{ oHomedir, "homedir", 2, "@" }, /* defaults to "~/.gnupg" */
|
||||||
|
{ oAgentProgram, "agent-program", 2 , "@" },
|
||||||
|
|
||||||
{ oNoBatch, "no-batch", 0, "@" },
|
{ oNoBatch, "no-batch", 0, "@" },
|
||||||
{ oWithColons, "with-colons", 0, "@"},
|
{ oWithColons, "with-colons", 0, "@"},
|
||||||
{ oWithKeyData,"with-key-data", 0, "@"},
|
{ oWithKeyData,"with-key-data", 0, "@"},
|
||||||
@ -707,6 +709,7 @@ main ( int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
case oNoOptions: break; /* no-options */
|
case oNoOptions: break; /* no-options */
|
||||||
case oHomedir: opt.homedir = pargs.r.ret_str; break;
|
case oHomedir: opt.homedir = pargs.r.ret_str; break;
|
||||||
|
case oAgentProgram: opt.agent_program = pargs.r.ret_str; break;
|
||||||
|
|
||||||
case oNoDefKeyring: default_keyring = 0; break;
|
case oNoDefKeyring: default_keyring = 0; break;
|
||||||
case oNoGreeting: nogreeting = 1; break;
|
case oNoGreeting: nogreeting = 1; break;
|
||||||
|
@ -38,6 +38,7 @@ struct {
|
|||||||
int dry_run; /* don't change any persistent data */
|
int dry_run; /* don't change any persistent data */
|
||||||
|
|
||||||
const char *homedir; /* configuration directory name */
|
const char *homedir; /* configuration directory name */
|
||||||
|
const char *agent_program;
|
||||||
char *outfile; /* name of output file */
|
char *outfile; /* name of output file */
|
||||||
|
|
||||||
int with_key_data;/* include raw key in the column delimted output */
|
int with_key_data;/* include raw key in the column delimted output */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user