The unified diff between revisions [b08b1694..] and [38c7ac4f..] is displayed below. It can also be downloaded as a raw diff.
#
#
# patch "cmd_netsync.cc"
# from [37e31660e83fcd5cd6cff8fd3b5b8b2f019181da]
# to [92564b21090c2ebc23734588bcaad5a6740b1c2f]
#
============================================================
--- cmd_netsync.cc 37e31660e83fcd5cd6cff8fd3b5b8b2f019181da
+++ cmd_netsync.cc 92564b21090c2ebc23734588bcaad5a6740b1c2f
@@ -247,23 +247,20 @@ CMD_AUTOMATE(push, N_("[ADDRESS[:PORTNUM
key_store keys(app);
project_t project(db);
- if (!app.opts.do_not_enforce_ssh_agent)
- {
- // enforce that any command which needs to encrypt a private key later on
- // uses the ssh_agent to do the task, because we cannot handle password
- // prompts over stdio. basically this is the same as giving --ssh-sign=only
- // as option to stdio, but it is more explicit. however, this also leaves
- // the opportunity of giving a possible passphrase via the get_passphrase
- // lua hook, because the ssh agent is _always_ used, but its a reasonable
- // trade-off
- keys.enforce_ssh_agent();
- }
-
netsync_connection_info info;
extract_client_connection_info(app.opts, app.lua, db, keys, args, info);
if (app.opts.signing_key() != "" && !app.opts.do_not_enforce_ssh_agent)
{
+ // enforce that any command which needs to encrypt a private key later on
+ // uses the ssh_agent to do the task, because we cannot handle password
+ // prompts over stdio. basically this is the same as giving --ssh-sign=only
+ // as option to stdio, but it is more explicit. however, this also leaves
+ // the opportunity of giving a possible passphrase via the get_passphrase
+ // lua hook, because the ssh agent is _always_ used, but its a reasonable
+ // trade-off
+ keys.enforce_ssh_agent();
+
N(keys.agent_knows_key(app.opts.signing_key),
F("key '%s' is unknown to the running ssh-agent instance")
% app.opts.signing_key);
@@ -305,7 +302,11 @@ CMD_AUTOMATE(pull, N_("[ADDRESS[:PORTNUM
key_store keys(app);
project_t project(db);
- if (!app.opts.do_not_enforce_ssh_agent)
+ netsync_connection_info info;
+ extract_client_connection_info(app.opts, app.lua, db, keys,
+ args, info, false);
+
+ if (app.opts.signing_key() != "" && !app.opts.do_not_enforce_ssh_agent)
{
// enforce that any command which needs to encrypt a private key later on
// uses the ssh_agent to do the task, because we cannot handle password
@@ -315,25 +316,11 @@ CMD_AUTOMATE(pull, N_("[ADDRESS[:PORTNUM
// lua hook, because the ssh agent is _always_ used, but its a reasonable
// trade-off
keys.enforce_ssh_agent();
- }
- netsync_connection_info info;
- extract_client_connection_info(app.opts, app.lua, db, keys,
- args, info, false);
-
- if (app.opts.signing_key() == "")
- {
- P(F("doing anonymous pull; use -kKEYNAME if you need authentication"));
+ N(keys.agent_knows_key(app.opts.signing_key),
+ F("key '%s' is unknown to the running ssh-agent instance")
+ % app.opts.signing_key);
}
- else
- {
- if (!app.opts.do_not_enforce_ssh_agent)
- {
- N(keys.agent_knows_key(app.opts.signing_key),
- F("key '%s' is unknown to the running ssh-agent instance")
- % app.opts.signing_key);
- }
- }
run_netsync_protocol(app.opts, app.lua, project, keys,
client_voice, sink_role, info);
@@ -375,7 +362,10 @@ CMD_AUTOMATE(sync, N_("[ADDRESS[:PORTNUM
key_store keys(app);
project_t project(db);
- if (!app.opts.do_not_enforce_ssh_agent)
+ netsync_connection_info info;
+ extract_client_connection_info(app.opts, app.lua, db, keys, args, info);
+
+ if (app.opts.signing_key() != "" && !app.opts.do_not_enforce_ssh_agent)
{
// enforce that any command which needs to encrypt a private key later on
// uses the ssh_agent to do the task, because we cannot handle password
@@ -385,13 +375,7 @@ CMD_AUTOMATE(sync, N_("[ADDRESS[:PORTNUM
// lua hook, because the ssh agent is _always_ used, but its a reasonable
// trade-off
keys.enforce_ssh_agent();
- }
- netsync_connection_info info;
- extract_client_connection_info(app.opts, app.lua, db, keys, args, info);
-
- if (app.opts.signing_key() != "" && !app.opts.do_not_enforce_ssh_agent)
- {
N(keys.agent_knows_key(app.opts.signing_key),
F("key '%s' is unknown to the running ssh-agent instance")
% app.opts.signing_key);