# # # patch "cmd_netsync.cc" # from [ba4c038a24ffe3ba8951da91b859c426c5876571] # to [6912103a56a1e5dfa13565b592c85fc837d2fd8e] # # patch "netsync.cc" # from [b74410f8fd40aefcf4f0a1c650426c1a0bb78437] # to [af9256a0375671de69a421969e46ce3632b639c9] # # patch "options_list.hh" # from [54ee12e3dfb608ca3a4b9a64cc51a845fc4a0501] # to [dba7ef1fb761c8027484328aeb5a15abf53430a3] # ============================================================ --- cmd_netsync.cc ba4c038a24ffe3ba8951da91b859c426c5876571 +++ cmd_netsync.cc 6912103a56a1e5dfa13565b592c85fc837d2fd8e @@ -426,7 +426,8 @@ CMD_NO_WORKSPACE(serve, "serve", "", CMD N_("Serves the database to connecting clients"), "", options::opts::bind | options::opts::pidfile | - options::opts::bind_stdio | options::opts::no_transport_auth) + options::opts::bind_stdio | options::opts::no_transport_auth | + options::opts::bind_local_socket ) { if (!args.empty()) throw usage(execid); @@ -443,7 +444,7 @@ CMD_NO_WORKSPACE(serve, "serve", "", CMD } else { - E(app.opts.bind_stdio, + E(app.opts.bind_stdio || app.opts.bind_local_socket, F("The --no-transport-auth option is only permitted in combination with --stdio")); } ============================================================ --- netsync.cc b74410f8fd40aefcf4f0a1c650426c1a0bb78437 +++ netsync.cc af9256a0375671de69a421969e46ce3632b639c9 @@ -14,6 +14,7 @@ #include #include #include +#include #include @@ -2765,7 +2766,14 @@ serve_connections(protocol_role role, Netxx::Address addr(use_ipv6); - if (!app.opts.bind_address().empty()) + if (app.opts.bind_local_socket) + { + try_again = use_ipv6 = false; + std::ostringstream local_url_ss; + local_url_ss << "local://" << app.opts.bind_path; + addr.add_address(local_url_ss.str().c_str()); + } + else if (!app.opts.bind_address().empty()) addr.add_address(app.opts.bind_address().c_str(), default_port); else addr.add_all_addresses (default_port); ============================================================ --- options_list.hh 54ee12e3dfb608ca3a4b9a64cc51a845fc4a0501 +++ options_list.hh dba7ef1fb761c8027484328aeb5a15abf53430a3 @@ -34,10 +34,12 @@ OPTSET(bind_opts) #endif OPTSET(bind_opts) -OPTVAR(bind, utf8, bind_address, ) -OPTVAR(bind, utf8, bind_port, ) -OPTVAR(bind, bool, bind_stdio, false) -OPTVAR(bind, bool, use_transport_auth, true) +OPTVAR(bind_opts, utf8, bind_address, ) +OPTVAR(bind_opts, utf8, bind_port, ) +OPTVAR(bind_opts, bool, bind_stdio, false) +OPTVAR(bind_opts, bool, use_transport_auth, true) +OPTVAR(bind_opts, bool, bind_local_socket, false) +OPTVAR(bind_opts, system_path, bind_path, ) OPTION(bind_opts, bind, true, "bind", gettext_noop("address:port to listen on (default :4691)")) @@ -72,6 +74,7 @@ OPTION(bind_opts, bind, true, "bind", } } bind_stdio = false; + bind_local_socket = false; bind_address = utf8(addr_part); bind_port = utf8(port_part); } @@ -91,6 +94,15 @@ OPTION(bind_opts, bind_stdio, false, "st } #endif +OPTION(bind_opts, bind_local_socket, true, "bind-local-socket", + gettext_noop("bind to a local domain socket")) +#ifdef option_bodies +{ + bind_local_socket = true; + bind_path = system_path(arg); +} +#endif + OPTVAR(branch, branch_name, branchname, ) OPTION(branch, branch, true, "branch,b", gettext_noop("select branch cert for operation"))