# # patch "ChangeLog" # from [228e8b5c33d810b22eefa4b4c63bbca9d0077d8c] # to [22ba71df72db6984078e3d1b21502f8c31efd691] # # patch "netsync.cc" # from [91acea7fcee4e14501eb9af1cc5510a1affd12c8] # to [714af142141424fa38317c98422d7a013e3537e4] # # patch "tests/t_epoch_server.at" # from [ed3df6e17c8510e91e8440a581c766c85ee4c8f2] # to [cf758cee3e08a84d727df1b43815cc30737d4190] # --- ChangeLog +++ ChangeLog @@ -1,5 +1,13 @@ 2005-05-31 Timothy Brownawell + * tests/t_epoch_server.at: fix typo + * netsync.cc (session::process_auth_cmd): If no branches are allowed + for writing, also check for write permissions to branch "" (needed + for serving empty dbs). For sync, don't refuse connection if there + are no readable branches (only do this for pull). + +2005-05-31 Timothy Brownawell + * monotone.texi: Update documentation for get_netsync_*_permitted hooks to reflect that they now get individual branch names. --- netsync.cc +++ netsync.cc @@ -1606,6 +1606,8 @@ } sort(names.begin(), names.end()); names.erase(std::unique(names.begin(), names.end()), names.end()); + if(!names.size()) + W(F("No branches found.")); } bool @@ -1786,7 +1788,9 @@ ok_branches.insert(utf8(*i)); } } - if(!ok_branches.size()) + //if we're source_and_sink_role, continue even with no branches readable + //ex: serve --db=empty.db + if(!ok_branches.size() && role == sink_role) { W(F("denied '%s' read permission for '%s'\n") % their_id % pattern); this->saved_nonce = id(""); @@ -1818,7 +1822,8 @@ ok_branches.insert(utf8(*i)); } } - if(!ok_branches.size()) + if(!ok_branches.size() + && !app.lua.hook_get_netsync_write_permitted("", their_id)) { W(F("denied '%s' write permission for '%s'\n") % their_id % pattern); this->saved_nonce = id(""); --- tests/t_epoch_server.at +++ tests/t_epoch_server.at @@ -1,4 +1,4 @@ -AT_SETUP([server aborbs and checks epochs]) +AT_SETUP([server absorbs and checks epochs]) AT_KEYWORDS([netsync]) MONOTONE_SETUP NETSYNC_SETUP