diff options
author | David Shaw <[email protected]> | 2003-05-01 21:37:08 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2003-05-01 21:37:08 +0000 |
commit | f861b6488ecc87e8dbc3ab45a1eca3189cf24834 (patch) | |
tree | 9a30d79c54be728b724398288db9d7c438bedd09 /g10/g10.c | |
parent | * build-packet.c (build_sig_subpkt): Comments. (diff) | |
download | gnupg-f861b6488ecc87e8dbc3ab45a1eca3189cf24834.tar.gz gnupg-f861b6488ecc87e8dbc3ab45a1eca3189cf24834.zip |
* tdbio.c (create_version_record): Only create new trustdbs with
TM_CLASSIC or TM_PGP.
* trustdb.h, trustdb.c (trust_string, get_ownertrust_string,
get_validity_string, ask_ownertrust, validate_keys), pkclist.c
(do_edit_ownertrust): Rename trust_string to trust_value_to_string for
naming consistency.
* trustdb.h, trustdb.c (string_to_trust_value): New function to translate
a string to a trust value.
* g10.c (main): Use string_to_trust_value here for --force-ownertrust.
* options.h, g10.c (main), trustdb.c (trust_model_string, init_trustdb,
check_trustdb, update_trustdb, get_validity, validate_one_keyblock): An
"OpenPGP" trust model is misleading since there is no official OpenPGP
trust model. Use "PGP" instead.
Diffstat (limited to 'g10/g10.c')
-rw-r--r-- | g10/g10.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -539,7 +539,7 @@ static ARGPARSE_OPTS opts[] = { { oDefCertCheckLevel, "default-cert-check-level", 1, "@"}, { oAlwaysTrust, "always-trust", 0, "@"}, { oTrustModel, "trust-model", 2, "@"}, - { oForceOwnertrust, "force-ownertrust", 1, "@"}, + { oForceOwnertrust, "force-ownertrust", 2, "@"}, { oEmuChecksumBug, "emulate-checksum-bug", 0, "@"}, { oRunAsShmCP, "run-as-shm-coprocess", 4, "@" }, { oSetFilename, "set-filename", 2, "@" }, @@ -1489,8 +1489,8 @@ main( int argc, char **argv ) time. */ case oAlwaysTrust: opt.trust_model=TM_ALWAYS; break; case oTrustModel: - if(ascii_strcasecmp(pargs.r.ret_str,"openpgp")==0) - opt.trust_model=TM_OPENPGP; + if(ascii_strcasecmp(pargs.r.ret_str,"pgp")==0) + opt.trust_model=TM_PGP; else if(ascii_strcasecmp(pargs.r.ret_str,"classic")==0) opt.trust_model=TM_CLASSIC; else if(ascii_strcasecmp(pargs.r.ret_str,"always")==0) @@ -1503,11 +1503,12 @@ main( int argc, char **argv ) case oForceOwnertrust: log_info(_("NOTE: %s is not for normal use!\n"), "--force-ownertrust"); - if(pargs.r.ret_int>=TRUST_UNDEFINED - && pargs.r.ret_int<=TRUST_ULTIMATE) - opt.force_ownertrust=pargs.r.ret_int; - else - log_error("invalid ownertrust %d\n",pargs.r.ret_int); + opt.force_ownertrust=string_to_trust_value(pargs.r.ret_str); + if(opt.force_ownertrust==-1) + { + log_error("invalid ownertrust \"%s\"\n",pargs.r.ret_str); + opt.force_ownertrust=0; + } break; case oLoadExtension: #ifndef __riscos__ |