monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Merging branch to allow duplicate key names, have c


From: Thomas Keller
Subject: Re: [Monotone-devel] Merging branch to allow duplicate key names, have certs use key hash
Date: Fri, 14 Aug 2009 12:20:29 +0200
User-agent: Thunderbird 2.0.0.22 (Macintosh/20090605)

Timothy Brownawell schrieb:
> I think branch net.venge.monotone.keys-by-hash is ready now.

Some more observations:

1) It might be helpful to output the filename / hash of a just generated
key and probably make the unique file a bit easier to grasp for people:

$ ./mtn genkey address@hidden
                    enter passphrase for key ID address@hidden
(...):
confirm passphrase for key ID address@hidden (...):
mtn: generating key-pair 'address@hidden'
mtn: storing key-pair 'address@hidden' in /Users/tommyd/.monotone/keys/


$ ls -l ~/.monotone/keys
-rw-------  1 tommyd  admin   1,2K 14 Aug 11:47
4ba4226e14c9bb57a2daf9698e76b8149256f20e

What about a filename like <keyname>.<hash> or something similar?

2) If mtn genkey stores keys as unique files, why should it prevent to
create a key with the same name again? Maybe I want to work with
different keys in different (unrelated) projects - it would be cool to
just have a --force-nonunique-keyname or something option to (automate)
genkey or at least give the user the hint "if you really want to do
this, temporarily move the conflicting key under $HOME/.monotone/keys
out of the way"

3) I now have two keys with the same key name "address@hidden" in
my local key store. My (old, unaltered) get_branch_key() hook still
points to "address@hidden" by default. If I try to make a test
commit without the --key option I get a weird exception:

mtn: beginning commit on branch 'biz.thomaskeller.keyhash-0.45-test'
mtn: fatal:
boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::io::too_many_args>
>: boost::too_many_args: format-string referred to less arguments than
were passed

(The full --debug output is attached)

4) I've added the following hook into my monotonerc:

function get_local_key_name(identity)
        if identity.id == "4ba4226e14c9bb57a2daf9698e76b8149256f20e" then
                return "my.new.key"
        end
        return identity.given_name;
end

to make the "new key" distinguishable from the old one. If I try to
specify the local name of the key during commit, however, monotone tells me

$ ./mtn ci --key my.new.key -m "test"
mtn: beginning commit on branch 'biz.thomaskeller.keyhash-0.45-test'
mtn: misuse: there is no key named 'my.new.key'

Whats even weirder though is that mtn doesn't seem to pick up my new
local_name:

$ ./mtn au keys
...
            hash [4ba4226e14c9bb57a2daf9698e76b8149256f20e]
      given_name "address@hidden"
      local_name "address@hidden"
 public_location "keystore"
private_location "keystore"

mtn ls keys additionally outputs two warnings:

mtn: warning: Some key names refer to multiple keys
mtn: warning: Mismatched Key: address@hidden

What does the second one means?

5) There is a small typo in monotone.texi, `get_author (branchname,
keyidentity)` should be `get_author (branchname, key_identity)`

6) What about the hooks `get_branch_key` and `get_netsync_key`? Is it
allowed now these hooks return a local name or key ID or do we still
assume the given_name here?

7) Should the format of read-permissions / write-permissions be extended
to allow listing of key ids / local names as well? I found no hints in
the branch's monotone.texi that anything has been changed there...

Thomas.

-- 
GPG-Key 0x160D1092 | address@hidden | http://thomaskeller.biz
Please note that according to the EU law on data retention, information
on every electronic information exchange might be retained for a period
of six months or longer: http://www.vorratsdatenspeicherung.de/?lang=en
mtn: searching for '_MTN' directory with root '/'
mtn: working root is '/Users/tommyd/Entwicklung/keyhash-0.45-test'
mtn: initial relative path is ''
mtn: opening rcfile '/Users/tommyd/.monotone/monotonerc'
mtn: '/Users/tommyd/.monotone/monotonerc' is ok
mtn: skipping nonexistent rcfile '_MTN/monotonerc'
mtn: searching for '_MTN' directory with root '/'
mtn: working root is '/Users/tommyd/Entwicklung/keyhash-0.45-test'
mtn: initial relative path is ''
mtn: opening rcfile '/Users/tommyd/.monotone/monotonerc'
mtn: '/Users/tommyd/.monotone/monotonerc' is ok
mtn: skipping nonexistent rcfile '_MTN/monotonerc'
mtn: loading lua hook get_default_command_options
mtn: local dump path is _MTN/debug
mtn: setting dump path to /Users/tommyd/Entwicklung/keyhash-0.45-test/_MTN/debug
mtn: loading lua hook note_mtn_startup
mtn: executing command 'ci'
mtn: options path is _MTN/options
mtn: branch name is 'biz.thomaskeller.keyhash-0.45-test'
mtn: options path is _MTN/options
mtn: writing _MTN/options via temp _MTN/mtyt3lsg.tmp
mtn: revision path is _MTN/revision
mtn: executing SQL 'SELECT sql FROM sqlite_master WHERE (type = 'table' OR type 
= 'index') AND sql IS NOT NULL AND name not like 'sqlite_stat%' ORDER BY name'
mtn: success
mtn: executing SQL 'PRAGMA user_version'
mtn: success
mtn: prepared statement SELECT 1 FROM manifests LIMIT 1
mtn: binding 0 parameters for SELECT 1 FROM manifests LIMIT 1
mtn: prepared statement SELECT 1 FROM revisions LIMIT 1
mtn: binding 0 parameters for SELECT 1 FROM revisions LIMIT 1
mtn: prepared statement SELECT 1 FROM rosters LIMIT 1
mtn: binding 0 parameters for SELECT 1 FROM rosters LIMIT 1
mtn: prepared statement SELECT 1 FROM heights LIMIT 1
mtn: binding 0 parameters for SELECT 1 FROM heights LIMIT 1
mtn: prepared statement SELECT id FROM revisions WHERE id = ?
mtn: binding 1 parameters for SELECT id FROM revisions WHERE id = ?
mtn: binding 1 with value '166d10fed2842b0a39b0710c2b0f2e886d34fda0'
mtn: prepared statement SELECT 1 FROM rosters WHERE id = ? LIMIT 1
mtn: binding 1 parameters for SELECT 1 FROM rosters WHERE id = ? LIMIT 1
mtn: binding 1 with value '166d10fed2842b0a39b0710c2b0f2e886d34fda0'
mtn: prepared statement SELECT checksum, data FROM rosters WHERE id = ?
mtn: binding 1 parameters for SELECT checksum, data FROM rosters WHERE id = ?
mtn: binding 1 with value '166d10fed2842b0a39b0710c2b0f2e886d34fda0'
mtn: prepared statement SELECT data FROM revisions WHERE id = ?
mtn: binding 1 parameters for SELECT data FROM revisions WHERE id = ?
mtn: binding 1 with value '166d10fed2842b0a39b0710c2b0f2e886d34fda0'
mtn: base roster has 2 entries
mtn: revision path is _MTN/revision
mtn: inodeprints path is _MTN/inodeprints
mtn: selected node 1  parent 0
mtn: adding node 1  parent 0
mtn: selected node 2 foo parent 1
mtn: adding node 2 foo parent 1
mtn: selected node 2147483648 blafoo parent 1
mtn: adding node 2147483648 blafoo parent 1
mtn: new manifest_id is 58477569e0220b6fa0a49ba8147a6e4c627ec531
mtn: beginning commit on branch 'biz.thomaskeller.keyhash-0.45-test'
mtn: new manifest '58477569e0220b6fa0a49ba8147a6e4c627ec531'
mtn: new revision '385e903a8254b51d0efcb44166efbce2376ac98c'
mtn: user log path is _MTN/log
mtn: loading lua hook edit_comment
mtn: spawning command: 'vi', 
'/var/folders/Yy/YyPTzxIOGMO-qQdxvQrxJk+++TI/-Tmp-//mtn.1EJKRM'
mtn: lua: extracted string = [b] test
mtn: user log path is _MTN/log
mtn: writing _MTN/log via temp _MTN/mt7pguhn.tmp
mtn: loading lua hook validate_commit_message
mtn: lua failure: isfunction() in get_fn; stack = nil
mtn: lua: extracted string =
mtn: Lua::ok(): failed
mtn: loading lua hook get_branch_key
mtn: lua: extracted string = address@hidden
mtn: Encountered an error while musing upon the following:
mtn: saving current work set: 4 items
mtn: finished saving work set
mtn: contents of work set:
mtn: Current work set: 4 items
mtn: ----- begin 'system_flavour' (in virtual void sanity::initialize(int, 
char**, const char*), at sanity.cc:103)
mtn: Darwin 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; 
root:xnu-1228.15.4~1/RELEASE_I386 i386
mtn: -----   end 'system_flavour' (in virtual void sanity::initialize(int, 
char**, const char*), at sanity.cc:103)
mtn: ----- begin 'cmdline_string' (in virtual void sanity::initialize(int, 
char**, const char*), at sanity.cc:117)
mtn: '../monotone/mtn', 'ci', '--debug'
mtn: -----   end 'cmdline_string' (in virtual void sanity::initialize(int, 
char**, const char*), at sanity.cc:117)
mtn: ----- begin 'string(lc_all)' (in virtual void sanity::initialize(int, 
char**, const char*), at sanity.cc:122)
mtn: de_DE.UTF-8
mtn: -----   end 'string(lc_all)' (in virtual void sanity::initialize(int, 
char**, const char*), at sanity.cc:122)
mtn: ----- begin 'full_version_string' (in virtual void 
mtn_sanity::initialize(int, char**, const char*), at mtn-sanity.cc:32)
mtn: monotone 0.45dev (base revision: 365807c594662036b64afb568b901acf70391207)
mtn: Running on          : Darwin 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 
16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386
mtn: C++ compiler        : GNU C++ version 4.0.1 (Apple Inc. build 5490)
mtn: C++ standard library: GNU libstdc++ version 20050421
mtn: Boost version       : 1_37
mtn: SQLite version      : 3.6.10 (compiled against 3.6.10)
mtn: Lua version         : Lua 5.1
mtn: PCRE version        : 7.8 2008-09-05 (compiled against 7.8)
mtn: Botan version       : 1.8.1 (compiled against 1.8.1)
mtn: Changes since base revision:
mtn: format_version "1"
mtn:
mtn: new_manifest [7e371bab74cdd46447bb1a2513147886ac72bf2f]
mtn:
mtn: old_revision [365807c594662036b64afb568b901acf70391207]
mtn: -----   end 'full_version_string' (in virtual void 
mtn_sanity::initialize(int, char**, const char*), at mtn-sanity.cc:32)
mtn: transforms.cc:88: detected general error, 'E(false)' violated
mtn: converting 12 bytes from UTF-8 to IDNA ACE
mtn: converting 3 bytes from UTF-8 to IDNA ACE
mtn: reading key dir '/Users/tommyd/.monotone/keys'
mtn: reading keys from file '4ba4226e14c9bb57a2daf9698e76b8149256f20e'
mtn: read keypair packet
mtn: reading key pair 'address@hidden' from key store
mtn: putting key pair '4ba4226e14c9bb57a2daf9698e76b8149256f20e'
mtn: successfully read key pair '4ba4226e14c9bb57a2daf9698e76b8149256f20e' from 
key store
mtn: reading keys from file 'address@hidden'
mtn: read keypair packet
mtn: reading key pair 'address@hidden' from key store
mtn: putting key pair '989686d0bea26bd70a952ff857a736c4e13d97af'
mtn: successfully read key pair '989686d0bea26bd70a952ff857a736c4e13d97af' from 
key store
mtn: reading keys from file 'address@hidden'
mtn: read keypair packet
mtn: reading key pair 'address@hidden' from key store
mtn: putting key pair '1aaecf3a7c227e5545b0504aea5d3716d3128117'
mtn: successfully read key pair '1aaecf3a7c227e5545b0504aea5d3716d3128117' from 
key store
mtn: loading lua hook get_local_key_name
mtn: lua: extracted string = address@hidden
mtn: loading lua hook get_local_key_name
mtn: lua: extracted string = address@hidden
mtn: loading lua hook get_local_key_name
mtn: lua: extracted string = address@hidden
mtn: prepared statement SELECT id FROM public_keys
mtn: binding 0 parameters for SELECT id FROM public_keys
mtn: prepared statement SELECT name, keydata FROM public_keys WHERE id = ?
mtn: binding 1 parameters for SELECT name, keydata FROM public_keys WHERE id = ?
mtn: binding 1 with value '1aaecf3a7c227e5545b0504aea5d3716d3128117'
mtn: loading lua hook get_local_key_name
mtn: lua: extracted string = address@hidden
mtn: statement cache statistics
mtn: prepared 10 statements
mtn: 1 executions of SELECT 1 FROM heights LIMIT 1
mtn: 1 executions of SELECT 1 FROM manifests LIMIT 1
mtn: 1 executions of SELECT 1 FROM revisions LIMIT 1
mtn: 1 executions of SELECT 1 FROM rosters LIMIT 1
mtn: 1 executions of SELECT 1 FROM rosters WHERE id = ? LIMIT 1
mtn: 1 executions of SELECT checksum, data FROM rosters WHERE id = ?
mtn: 1 executions of SELECT data FROM revisions WHERE id = ?
mtn: 1 executions of SELECT id FROM public_keys
mtn: 1 executions of SELECT id FROM revisions WHERE id = ?
mtn: 1 executions of SELECT name, keydata FROM public_keys WHERE id = ?
mtn: fatal: 
boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::io::too_many_args>
 >: boost::too_many_args: format-string referred to less arguments than were 
passed
mtn: this is almost certainly a bug in monotone.
mtn: please send this error message, the output of 'mtn version --full',
mtn: and a description of what you were doing to address@hidden
mtn: wrote debugging log to 
/Users/tommyd/Entwicklung/keyhash-0.45-test/_MTN/debug
mtn: if reporting a bug, please include this file

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]