]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
Fix ssh option configuration ordering for snbk ssh-push targets 1150/head
authorDevansh-567 <devansh.jay.singh@gmail.com>
Mon, 22 Jun 2026 06:48:32 +0000 (12:18 +0530)
committerDevansh-567 <devansh.jay.singh@gmail.com>
Mon, 22 Jun 2026 06:48:32 +0000 (12:18 +0530)
client/snbk/BackupConfig.cc

index 5195da1b2280da2caca611391b5ba79f040c5848..35b2633ebba0350e7967b1f4ba8afb7d2d74ebca 100644 (file)
@@ -107,7 +107,7 @@ namespace snapper
     vector<string>
     BackupConfig::ssh_options() const
     {
-       vector<string> options = { ssh_host };
+       vector<string> 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;
     }