# # # patch "NEWS" # from [6f8edd88e9009a6bfa5bd12c1908d65f126cae20] # to [8acae2b45bc19f81b80d174f02ca4e30be298d84] # # patch "cmd_key_cert.cc" # from [b6ed35efc25497f2347adb2cbd7966c6c7c88e7c] # to [673244e134e677a9aa72098975815e39d1421b83] # # patch "cmd_packet.cc" # from [a8e747e04000557bb5bc67405bdeb6425181f7f6] # to [d6f3d0fc93298755059b061e3108ee3ddbd46527] # # patch "monotone.texi" # from [0485b5b43a479b58e9d2ce2b82fc365a8f93c281] # to [96ef19a39e96a8babeca86d18f6b076f333ac127] # # patch "tests/automate_key_manage/__driver__.lua" # from [18728ef835aa1fae912f3ce587a4c6b3bf892c7b] # to [31053a9f53f5fddfe9ff583a324d998a35bd4456] # ============================================================ --- NEWS 6f8edd88e9009a6bfa5bd12c1908d65f126cae20 +++ NEWS 8acae2b45bc19f81b80d174f02ca4e30be298d84 @@ -83,8 +83,8 @@ Xxx Xxx 99 99:99:99 UTC 2010 New Features - - New automate commands 'pubkey' and 'drop_public_key'. Closes - bug 30345. + - New automate commands 'get_public_key' and + 'drop_public_key'. Closes bug 30345. - The 'disapprove' command now accepts a revision range in addition to a single revision. ============================================================ --- cmd_key_cert.cc b6ed35efc25497f2347adb2cbd7966c6c7c88e7c +++ cmd_key_cert.cc 673244e134e677a9aa72098975815e39d1421b83 @@ -138,9 +138,9 @@ static void } static void -dropkey_common (app_state & app, - args_vector args, - bool drop_private) +dropkey_common(app_state & app, + args_vector args, + bool drop_private) { database db(app); key_store keys(app); @@ -191,8 +191,8 @@ CMD(dropkey, "dropkey", "", CMD_REF(key_ if (args.size() != 1) throw usage(execid); - dropkey_common (app, args, - true); // drop_private + dropkey_common(app, args, + true); // drop_private } CMD_AUTOMATE(drop_public_key, N_("KEY_NAME_OR_HASH"), @@ -203,8 +203,8 @@ CMD_AUTOMATE(drop_public_key, N_("KEY_NA E(args.size() == 1, origin::user, F("wrong argument count")); - dropkey_common (app, args, - false); // drop_private + dropkey_common(app, args, + false); // drop_private } CMD(passphrase, "passphrase", "", CMD_REF(key_and_cert), N_("KEY_NAME_OR_HASH"), ============================================================ --- cmd_packet.cc a8e747e04000557bb5bc67405bdeb6425181f7f6 +++ cmd_packet.cc d6f3d0fc93298755059b061e3108ee3ddbd46527 @@ -26,9 +26,9 @@ static void using std::vector; static void -pubkey_common (app_state & app, - args_vector args, - std::ostream & output) +pubkey_common(app_state & app, + args_vector args, + std::ostream & output) { database db(app); key_store keys(app); @@ -67,10 +67,10 @@ CMD(pubkey, "pubkey", "", CMD_REF(packet if (args.size() != 1) throw usage(execid); - pubkey_common (app, args, cout); + pubkey_common(app, args, cout); } -CMD_AUTOMATE(pubkey, N_("KEY_NAME_OR_HASH"), +CMD_AUTOMATE(get_public_key, N_("KEY_NAME_OR_HASH"), N_("Prints a public key packet"), "", options::opts::none) @@ -78,7 +78,7 @@ CMD_AUTOMATE(pubkey, N_("KEY_NAME_OR_HAS E(args.size() == 1, origin::user, F("wrong argument count")); - pubkey_common (app, args, output); + pubkey_common(app, args, output); } CMD(privkey, "privkey", "", CMD_REF(packet_io), N_("ID"), ============================================================ --- monotone.texi 0485b5b43a479b58e9d2ce2b82fc365a8f93c281 +++ monotone.texi 96ef19a39e96a8babeca86d18f6b076f333ac127 @@ -9341,7 +9341,7 @@ @section Automation @end table address@hidden mtn automate pubkey @var{keyid} address@hidden mtn automate get_public_key @var{keyid} @table @strong @item Arguments: @@ -9396,12 +9396,19 @@ @section Automation @item Purpose: -Same as @command{dropkey}, except that it does not drop private keys. This -command should be used with caution as changes are irreversible -without a backup of the key(s) that were dropped. +Drop a public key from the database (does @emph{not} drop private or +public keys from the keystore). Signatures made with the key can no +longer be verified. -Private keys are not dropped because that is very dangerous on a -server. The only way to drop private keys on a server is via the +This command should be used with caution as changes are irreversible +without a backup of the key(s) that were dropped. You may wish to use +the @command{k:} selector to check if the key is used in a signature. + +Note that public keys that are used to sign a revision may be +restored to the database by a future sync. + +Keys in the keystore are not dropped because that is very dangerous on +a server. The only way to drop private keys on a server is via the direct @command{mtn dropkey}. @item Sample output: ============================================================ --- tests/automate_key_manage/__driver__.lua 18728ef835aa1fae912f3ce587a4c6b3bf892c7b +++ tests/automate_key_manage/__driver__.lua 31053a9f53f5fddfe9ff583a324d998a35bd4456 @@ -14,7 +14,7 @@ rename("stdout", "key_packet") -- non-automate output uses OS-specific line endings, while automate uses Unix line endings. canonicalize("stdout") rename("stdout", "key_packet") -check(mtn("automate", "pubkey", "address@hidden"), 0, true) +check(mtn("automate", "get_public_key", "address@hidden"), 0, true) check(samefile("stdout", "key_packet")) check(mtn("automate", "drop_public_key", "address@hidden"), 0, false, false)