Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: GnuPG: devel

Poldi bug report: quieter, better prompts

 

 

GnuPG devel RSS feed   Index | Next | Previous | View Threaded


lionel at mamane

Jul 30, 2009, 10:46 AM

Post #1 of 2 (480 views)
Permalink
Poldi bug report: quieter, better prompts

Poldi is quite chatty in the PAM conversation, even when not in debug
mode. This patch cuts on that. It is mainly justified by the fact that
xscreensaver requires a positive user action (click "OK" button) for
every conv_tell, so I don't what any more than necessary / useful.

I've also tweaked the prompts I left in non-debug mode, and inserted
some helpful-for-the-user error messages in the PAM dialog.

--- poldi-0.4.1.orig/src/pam/pam_poldi.c
+++ poldi-0.4.1/src/pam/pam_poldi.c
@@ -480,12 +480,12 @@
{
if (ctx->debug)
log_msg_debug (ctx->loghandle, _("Waiting for card for user `%s'..."), pam_username);
- conv_tell (ctx->conv, _("Waiting for card for user `%s'..."), pam_username);
+ conv_tell (ctx->conv, _("Insert authentication card for user `%s'"), pam_username);
}
else
{
if (ctx->debug)
log_msg_debug (ctx->loghandle, _("Waiting for card..."));
- conv_tell (ctx->conv, _("Waiting for card..."));
+ conv_tell (ctx->conv, _("Insert authentication card"));
}

--- poldi-0.4.1.orig/src/pam/auth-method-localdb/auth-localdb.c
+++ poldi-0.4.1/src/pam/auth-method-localdb/auth-localdb.c
@@ -117,10 +117,12 @@
username = username_desired;

if (ctx->debug)
- log_msg_debug (ctx->conv,
- _("Trying authentication as user `%s'..."), username);
- conv_tell (ctx->conv,
- _("Trying authentication as user `%s'..."), username);
+ {
+ log_msg_debug (ctx->conv,
+ _("Trying authentication as user `%s'..."), username);
+ conv_tell (ctx->conv,
+ _("Trying authentication as user `%s'..."), username);
+ }

/* Verify (again) that the given account is associated with the
serial number. */
@@ -128,12 +130,14 @@
if (err)
{
if (ctx->debug)
- log_msg_debug (ctx->loghandle,
- _("Serial number %s is not associated with user %s"),
- ctx->cardinfo.serialno, username);
- conv_tell (ctx->conv,
- _("Serial number %s is not associated with user %s"),
- ctx->cardinfo.serialno, username);
+ {
+ log_msg_debug (ctx->loghandle,
+ _("Serial number %s is not associated with user %s"),
+ ctx->cardinfo.serialno, username);
+ conv_tell (ctx->conv,
+ _("Serial number %s is not associated with user %s"),
+ ctx->cardinfo.serialno, username);
+ }
err = gcry_error (GPG_ERR_INV_NAME);
goto out;
}
--- poldi-0.4.1.orig/src/pam/auth-support/getpin-cb.c
+++ poldi-0.4.1/src/pam/auth-support/getpin-cb.c
@@ -81,9 +81,12 @@
Shouldn't they be done in scdaemon itself? -mo */

if (strlen (buffer) < 6) /* FIXME? is it really minimum of 6 bytes? */
- log_msg_error (ctx->loghandle, _("invalid PIN"));
+ {
+ log_msg_error (ctx->loghandle, _("PIN too short"));
+ conv_tell(ctx->conv, "%s", _("PIN too short"));
+ }
else if (!all_digitsp (buffer))
log_msg_error (ctx->loghandle, _("invalid characters in PIN"));
else
break;
}
@@ -235,7 +241,7 @@
err = query_user (ctx, info_frobbed, buf, maxbuf);
else
/* Use string which is more user friendly. */
- err = query_user (ctx, _("||Please enter the PIN"), buf, maxbuf);
+ err = query_user (ctx, _("Please enter the PIN: "), buf, maxbuf);
}
else
{
@@ -254,7 +260,7 @@
if (info_frobbed)
err = keypad_mode_enter (ctx, info_frobbed);
else
- err = keypad_mode_enter (ctx, _("||Please enter the PIN"));
+ err = keypad_mode_enter (ctx, _("Please enter the PIN: "));
}
else
err = gpg_error (GPG_ERR_INV_VALUE); /* FIXME: must signal


--
Lionel

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


mo at g10code

Aug 8, 2009, 11:07 AM

Post #2 of 2 (435 views)
Permalink
Re: Poldi bug report: quieter, better prompts [In reply to]

Dear Lionel,

Regarding Poldi being rather chatty: that has already been changed in
SVN trunk. I have reintroduced the "quiet" option a couple of weeks ago
and protected several calls to conv_tell() by "if (!quiet)".

I have applied the string substitutions you suggested.

Thanks,
mo
Attachments: signature.asc (0.26 KB)

GnuPG devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.