added new command line option for adding rhizome bundle with authorship

so that it includes a BK.
All good, except the BK isn't being added. Yet to find out why.
This commit is contained in:
gardners 2012-05-15 22:15:13 +09:30
parent 0eafc34970
commit 39be8a0b75
2 changed files with 6 additions and 0 deletions

View File

@ -1082,6 +1082,7 @@ int app_rhizome_add_file(int argc, const char *const *argv, struct command_line_
/* Add the manifest and its associated file to the Rhizome database, generating an "id" in the
* process */
rhizome_manifest *mout = NULL;
WHYF("calling rhizome_add_manifest, author='%s'",authorisingSid);
int ret = rhizome_add_manifest(m, &mout, filepath,
NULL, // no groups - XXX should allow them
255, // ttl - XXX should read from somewhere
@ -1501,6 +1502,8 @@ command_line_option command_line_options[]={
"Get specified configuration variable."},
{app_rhizome_add_file,{"rhizome","add","file","<filepath>","[<manifestpath>]",NULL},CLIFLAG_STANDALONE,
"Add a file to Rhizome and optionally write its manifest to the given path"},
{app_rhizome_add_file,{"rhizome","add","authored","file","<filepath>","<sid>","[<manifestpath>]",NULL},CLIFLAG_STANDALONE,
"Add a file to Rhizome and remember who authored it, so that they can modify the bundle later."},
{app_rhizome_list,{"rhizome","list","[<offset>]","[<limit>]",NULL},CLIFLAG_STANDALONE,
"List all manifests and files in Rhizome"},
{app_rhizome_extract_manifest,{"rhizome","extract","manifest","<manifestid>","[<manifestpath>]",NULL},CLIFLAG_STANDALONE,

View File

@ -275,7 +275,10 @@ int rhizome_add_manifest(rhizome_manifest *m_in,
if (!rhizome_bk_xor(author,m_in->cryptoSignPublic,
m_in->cryptoSignPublic,
bkbytes)) {
WHYF("set BK='%s'",rhizome_bytes_to_hex(bkbytes,len));
rhizome_manifest_set(m_in,"BK",rhizome_bytes_to_hex(bkbytes,len));
} else {
WHY("Failed to set BK");
}
}
}