mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* keygen.c (ask_user_id): Make --allow-freeform-uid apply to the email
field as well as the name field, and allow mixing fields when it is set.
This commit is contained in:
parent
6713fbc3a9
commit
7bf7cdb476
2 changed files with 12 additions and 4 deletions
10
g10/keygen.c
10
g10/keygen.c
|
@ -1266,7 +1266,7 @@ ask_user_id( int mode )
|
|||
amail = cpr_get("keygen.email",_("Email address: "));
|
||||
trim_spaces(amail);
|
||||
cpr_kill_prompt();
|
||||
if( !*amail )
|
||||
if( !*amail || opt.allow_freeform_uid )
|
||||
break; /* no email address is okay */
|
||||
else if( has_invalid_email_chars(amail)
|
||||
|| string_count_chr(amail,'@') != 1
|
||||
|
@ -1319,11 +1319,13 @@ ask_user_id( int mode )
|
|||
|
||||
tty_printf(_("You selected this USER-ID:\n \"%s\"\n\n"), uid);
|
||||
/* fixme: add a warning if this user-id already exists */
|
||||
if( !*amail && (strchr( aname, '@' ) || strchr( acomment, '@'))) {
|
||||
if( !*amail && !opt.allow_freeform_uid
|
||||
&& (strchr( aname, '@' ) || strchr( acomment, '@')))
|
||||
{
|
||||
fail = 1;
|
||||
tty_printf(_("Please don't put the email address "
|
||||
"into the real name or the comment\n") );
|
||||
}
|
||||
"into the real name or the comment\n") );
|
||||
}
|
||||
|
||||
for(;;) {
|
||||
const char *ansstr = _("NnCcEeOoQq");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue