mirror of git://git.gnupg.org/gnupg.git
gpg: Workaround for junk after --trusted-key.
* g10/trust.c (register_trusted_key): Cut off everthing starting as a
hash sign.
--
This problem is fallout from
commit f99830b728
which fixes
GnuPG-bug-id: 1206
The same could happen with other options taking keyids but we won't
change that because a trailing '#' does not indicate a comment. So
this is really only a workaround and eventually we will
deprecate --trusted-key anyway or require a fingerprint as a value.
Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
e725c4d653
commit
b509d81cab
20
g10/trust.c
20
g10/trust.c
|
@ -66,6 +66,26 @@ register_trusted_key (const char *string)
|
||||||
#ifdef NO_TRUST_MODELS
|
#ifdef NO_TRUST_MODELS
|
||||||
(void)string;
|
(void)string;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
/* Some users have conf files with entries like
|
||||||
|
* trusted-key 0x1234567812345678 # foo
|
||||||
|
* That is obviously wrong. Before fixing bug#1206 trailing garbage
|
||||||
|
* on a key specification if was ignored. We detect the above use case
|
||||||
|
* here and cut off the junk-looking-like-a comment. */
|
||||||
|
if (strchr (string, '#'))
|
||||||
|
{
|
||||||
|
char *buf;
|
||||||
|
|
||||||
|
buf = xtrystrdup (string);
|
||||||
|
if (buf)
|
||||||
|
{
|
||||||
|
*strchr (buf, '#') = 0;
|
||||||
|
tdb_register_trusted_key (buf);
|
||||||
|
xfree (buf);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tdb_register_trusted_key (string);
|
tdb_register_trusted_key (string);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue