[X2Go-Commits] [x2goserver] 87/99: X2Go/Server/Agent/NX/Options.pm: actually check for a specific value in the kv-pair filter function if so specified.

git-admin at x2go.org git-admin at x2go.org
Mon Dec 28 06:10:53 CET 2020


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2goserver.

commit 4a7da0acdc9a9b0b455d3f837a55e67ded611705
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Thu Dec 10 17:24:41 2020 +0100

    X2Go/Server/Agent/NX/Options.pm: actually check for a specific value in the kv-pair filter function if so specified.
    
    Big oops.
---
 X2Go/Server/Agent/NX/Options.pm | 12 ++++++++----
 debian/changelog                |  2 ++
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/X2Go/Server/Agent/NX/Options.pm b/X2Go/Server/Agent/NX/Options.pm
index ca22b1fa..c4010d54 100644
--- a/X2Go/Server/Agent/NX/Options.pm
+++ b/X2Go/Server/Agent/NX/Options.pm
@@ -492,16 +492,20 @@ sub filter_find_key {
            || (0 == $elems_left));
 
   if (!($skip)) {
-    # We don't care about the values this time around.
-
     my $option_key = q{};
+    my $option_value = q{};
 
     foreach my $tmp_option_key (keys (%{$cur_option})) {
       $option_key = $tmp_option_key;
+      $option_value = $cur_option->{$tmp_option_key};
     }
 
     if ($option_key eq $needle_key) {
-      $ret = 1;
+      # If we were asked to check for a specific value, i.e., if it defined,
+      # do that, too.
+      if ((!(defined ($needle_value))) || ($option_value eq $needle_value)) {
+        $ret = 1;
+      }
     }
   }
 
@@ -639,7 +643,7 @@ sub transform_intermediate {
       # another dependency and option strings are pretty small, so don't
       # overoptimize here.
       ## no critic (BuiltinFunctions::ProhibitBooleanGrep)
-      if (scalar (grep { filter_find_key ($work_option_key, $work_option_value, $_, --$elements_left) } @{$ret})) {
+      if (scalar (grep { filter_find_key ($work_option_key, undef, $_, --$elements_left) } @{$ret})) {
       ## critic (BuiltinFunctions::ProhibitBooleanGrep)
         # Such an option already exists, we'll modify all occurrences.
         $elements_left = @{$ret};
diff --git a/debian/changelog b/debian/changelog
index 061d90d7..4b4311a5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -364,6 +364,8 @@ x2goserver (4.1.0.4-0x2go1.2) UNRELEASED; urgency=medium
       extraction.
     - x2goserver/bin/x2goupdateoptionsstring: add base64 encode and decode
       helpers, add new --base64 parameter that enabled global use of base64.
+    - X2Go/Server/Agent/NX/Options.pm: actually check for a specific value in
+      the kv-pair filter function if so specified. Big oops.
   * debian/control:
     + Build-depend upon lsb-release for distro version detection.
   * debian/x2goserver.manpages:

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goserver.git


More information about the x2go-commits mailing list