# # # patch "netsync.cc" # from [4387f8b327d8841a069df2e25c6bc00075db4632] # to [f5e514d79d677707147093b076dc8d232aabc07c] # # patch "tests/netsync_hook_errcodes/__driver__.lua" # from [1e4504885124bfa64eeb91ce357c3a8f4820a94b] # to [78865e3aacd8877e82dd219581c9b0154ec05ac2] # # patch "tests/netsync_permissions/__driver__.lua" # from [9206b414713e9b678316304d3ce071543cc5433b] # to [a19613f2700037bff44aa9880d8106ddf54e72a5] # ============================================================ --- netsync.cc 4387f8b327d8841a069df2e25c6bc00075db4632 +++ netsync.cc f5e514d79d677707147093b076dc8d232aabc07c @@ -1608,6 +1608,10 @@ session::process_auth_cmd(protocol_role project.db.put_key(their_key_id, their_keypair.pub); else { + return process_anonymous_cmd(their_role, + their_include_pattern, + their_exclude_pattern); + /* this->saved_nonce = id(""); lua.hook_note_netsync_start(session_id, "server", their_role, @@ -1617,6 +1621,7 @@ session::process_auth_cmd(protocol_role error(unknown_key, (F("remote public key hash '%s' is unknown") % encode_hexenc(client())).str()); + */ } } ============================================================ --- tests/netsync_hook_errcodes/__driver__.lua 1e4504885124bfa64eeb91ce357c3a8f4820a94b +++ tests/netsync_hook_errcodes/__driver__.lua 78865e3aacd8877e82dd219581c9b0154ec05ac2 @@ -58,7 +58,7 @@ srv:stop() srv = netsync.start() srv:sync({"testbranch", "address@hidden"}, 2, 1) srv:stop() -chk_errcode_is(422) +chk_errcode_is(412) -- anonymous write (was 422 unknown key) clearnotes() check(mtn("db", "set_epoch", "testbranch", string.rep("0", 40))) ============================================================ --- tests/netsync_permissions/__driver__.lua 9206b414713e9b678316304d3ce071543cc5433b +++ tests/netsync_permissions/__driver__.lua a19613f2700037bff44aa9880d8106ddf54e72a5 @@ -57,14 +57,14 @@ check(mtn2("automate", "get_revision", r srv:pull({"testbranch", "--key", keys.other}) check(mtn2("automate", "get_revision", revs.base), 0, true, true) --- pull with unknown key fails +-- pull with unknown key falls back to anonymous clean(2) keys.unknown = "address@hidden" genkey(keys.unknown, mtn2) -srv:pull({"testbranch", "--key", keys.unknown}, nil, 1) -check(mtn2("automate", "get_revision", revs.base), 1, true, true) +srv:pull({"testbranch", "--key", keys.unknown}, nil, 0) +check(mtn2("automate", "get_revision", revs.base), 0, true, true) -- push with default key