From ed7d9e18362ec11028b28bffe2af8dd4449dc8b9 Mon Sep 17 00:00:00 2001 From: Carl Johnsen Date: Fri, 7 Feb 2025 09:09:16 +0100 Subject: [PATCH] Fixed incorrect options precedence. [src|dst] options override global options --- Tools/RemoteSynchronization/Program.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Tools/RemoteSynchronization/Program.cs b/Tools/RemoteSynchronization/Program.cs index 0586d8daf..73d6d805c 100644 --- a/Tools/RemoteSynchronization/Program.cs +++ b/Tools/RemoteSynchronization/Program.cs @@ -1,4 +1,4 @@ -// Copyright (C) 2025, The Duplicati Team +// Copyright (C) 2025, The Duplicati Team // https://duplicati.com, hello@duplicati.com // // Permission is hereby granted, free of charge, to any person obtaining a @@ -172,9 +172,14 @@ destination will be verified before being overwritten (if they seemingly match). .Select(x => x.Split("=")) .ToDictionary(x => x[0], x => x[1]); - // Merge the global options into the source and destination options + // Merge the global options into the source and destination options. The global options will be overridden by the source and destination options. foreach (var x in global_options) - src_opts[x.Key] = dst_opts[x.Key] = x.Value; + { + if (!src_opts.ContainsKey(x.Key)) + src_opts[x.Key] = x.Value; + if (!dst_opts.ContainsKey(x.Key)) + dst_opts[x.Key] = x.Value; + } // Check if we only had to parse the arguments if (config.ParseArgumentsOnly)