1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

* command.c (cmd_get_passphrase): Remove the plus signs.

* query.c (start_pinentry): Send no-grab option to pinentry
* gpg-agent.c (main): Move variable grab as no_grab to agent.h.
This commit is contained in:
Werner Koch 2002-01-20 16:49:10 +00:00
parent eac306fc90
commit 6aae6603af
5 changed files with 35 additions and 9 deletions

View File

@ -1,3 +1,10 @@
2002-01-20 Werner Koch <wk@gnupg.org>
* command.c (cmd_get_passphrase): Remove the plus signs.
* query.c (start_pinentry): Send no-grab option to pinentry
* gpg-agent.c (main): Move variable grab as no_grab to agent.h.
2002-01-19 Werner Koch <wk@gnupg.org>
* gpg-agent.c (main): Disable core dumps.

View File

@ -36,6 +36,7 @@ struct {
int batch; /* batch mode */
const char *homedir; /* configuration directory name */
const char *pinentry_program;
int no_grab; /* don't let the pinentry grab the keyboard */
} opt;

View File

@ -266,6 +266,16 @@ cmd_genkey (ASSUAN_CONTEXT ctx, char *line)
}
static void
plus_to_blank (char *s)
{
for (; *s; s++)
{
if (*s == '+')
*s = ' ';
}
}
/* GET_PASSPHRASE <cache_id> [<error_message> <prompt> <description>]
This function is usually used to ask for a passphrase to be used
@ -340,6 +350,17 @@ cmd_get_passphrase (ASSUAN_CONTEXT ctx, char *line)
}
else
{
/* Note, that we only need to repalce the + characters and
should leave the other escaping in place becuase the escaped
sting is send verbatim to the pinentry which does the
unescaping (but not the + replacing) */
if (errtext)
plus_to_blank (errtext);
if (prompt)
plus_to_blank (prompt);
if (desc)
plus_to_blank (desc);
rc = agent_get_passphrase (&response, desc, prompt, errtext);
if (!rc)
{

View File

@ -229,7 +229,6 @@ main (int argc, char **argv )
int nogreeting = 0;
int pipe_server = 0;
int nodetach = 0;
int grab = 0;
int csh_style = 0;
char *logfile = NULL;
int debug_wait = 0;
@ -269,7 +268,6 @@ main (int argc, char **argv )
opt.homedir = "~/.gnupg-test";
#endif
}
grab = 1;
/* check whether we have a config file on the commandline */
orig_argc = argc;
@ -363,7 +361,7 @@ main (int argc, char **argv )
case oNoOptions: break; /* no-options */
case oHomedir: opt.homedir = pargs.r.ret_str; break;
case oNoDetach: nodetach = 1; break;
case oNoGrab: grab = 0; break;
case oNoGrab: opt.no_grab = 1; break;
case oLogFile: logfile = pargs.r.ret_str; break;
case oCsh: csh_style = 1; break;
case oSh: csh_style = 0; break;

View File

@ -95,12 +95,11 @@ start_pinentry (void)
log_debug ("connection to PIN entry established\n");
if (DBG_COMMAND)
{
log_debug ("waiting for debugger [hit RETURN when ready] .....\n");
getchar ();
log_debug ("... okay\n");
}
rc = assuan_transact (entry_ctx,
opt.no_grab? "OPTION no-grab":"OPTION grab",
NULL, NULL, NULL, NULL);
if (rc)
return map_assuan_err (rc);
return 0;
}