This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goserver. commit 74fe23368d747cb4e986f3827c03b94eb6e2acd3 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Nov 26 07:10:53 2020 +0100 x2goserver/bin/x2goupdateoptionsstring: add non-functional extraction mode. Needs proper implementation. --- debian/changelog | 2 ++ x2goserver/bin/x2goupdateoptionsstring | 33 +++++++++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3ebc9408..a27759b1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -334,6 +334,8 @@ x2goserver (4.1.0.4-0x2go1.2) UNRELEASED; urgency=medium - {X2Go/Server/Agent/NX/Options.pm, x2goserver/bin/x2goupdateoptionsstring}: fatalize text coding errors. - x2goserver/bin/x2goupdateoptionsstring: sanitize/convert data in @ARGV. + - x2goserver/bin/x2goupdateoptionsstring: add non-functional extraction + mode. Needs proper implementation. * debian/control: + Build-depend upon lsb-release for distro version detection. * debian/x2goserver.manpages: diff --git a/x2goserver/bin/x2goupdateoptionsstring b/x2goserver/bin/x2goupdateoptionsstring index 9494c465..b0201629 100755 --- a/x2goserver/bin/x2goupdateoptionsstring +++ b/x2goserver/bin/x2goupdateoptionsstring @@ -45,6 +45,7 @@ use Pod::Usage; use Storable qw (dclone); use Data::Dumper qw (Dumper); use X2Go::Server::Agent::NX::Options; +use MIME::Base64 qw (encode_base64); use List::Util qw (max); use Encode qw (encode decode); @@ -523,7 +524,7 @@ sub Main { print {*STDERR} 'Dumping intermediate array after initial parsing: ' . Dumper ($intermediate); } - if ($compact) { + if (((MODE_EXTRACT_DATA)[1] == $mode) || ($compact)) { $intermediate = X2Go::Server::Agent::NX::Options::compact_intermediate ($intermediate); if (!(defined ($intermediate))) { @@ -557,13 +558,37 @@ sub Main { last; } } + elsif ((MODE_EXTRACT_DATA)[1] == $mode) { + my $extract = extract_data ($intermediate, $cur_arg, $debug); + + if (!(defined ($extract)) { + print {*STDERR} 'Unable to extract data for "' . $cur_arg . '"' . ", aborting.\n"; + $error_detected = 11; + } + else { + # Convert into bytes. + $bytes = encode ("UTF-8", $extract, Encode::FB_CROAK); + + # Encode the data. + my $base64 = base64_encode ($extract, q{}); + + if (!(defined ($out))) { + # Create it. + $out = $base64; + } + else { + # Otherwise, append and make sure to separate fields. + $out .= q{|} . $base64; + } + } + } # Skip pseudo-option, if necessary. $sanitized_options = sanitize_program_options (\@program_arguments, (!($found_separator))); if (!(defined ($sanitized_options))) { pod2usage (-exitval => 'NOEXIT'); - $error_detected = 11; + $error_detected = 12; last; } elsif ($debug) { @@ -577,7 +602,7 @@ sub Main { if ((!($error_detected)) && (!($operation))) { print {*STDERR} "No operation carried out, aborting.\n"; - $error_detected = 12; + $error_detected = 13; } } @@ -587,7 +612,7 @@ sub Main { if (!(defined ($out))) { print {*STDERR} "Unable to transform intermediate back into string, aborting.\n"; - $error_detected = 13; + $error_detected = 14; } } } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goserver.git