From: Devansh-567 Date: Mon, 22 Jun 2026 06:48:32 +0000 (+0530) Subject: Fix ssh option configuration ordering for snbk ssh-push targets X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1150%2Fhead;p=thirdparty%2Fsnapper.git Fix ssh option configuration ordering for snbk ssh-push targets --- diff --git a/client/snbk/BackupConfig.cc b/client/snbk/BackupConfig.cc index 5195da1b..35b2633e 100644 --- a/client/snbk/BackupConfig.cc +++ b/client/snbk/BackupConfig.cc @@ -107,7 +107,7 @@ namespace snapper vector BackupConfig::ssh_options() const { - vector options = { ssh_host }; + vector options; if (ssh_port != 0) options.insert(options.end(), { "-p", to_string(ssh_port) }); @@ -122,6 +122,9 @@ namespace snapper options.insert(options.end(), { "-o", "ControlMaster=auto", "-o", "ControlPath=\"~/.ssh/snbk-%C\"", "-o", "ControlPersist=30s" }); + // The target host must be the final argument before the command string execution block + options.push_back(ssh_host); + return options; }