This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goserver. commit 9049cb7bf80ede3b741eda2ceac56236a7c05ec3 Author: Matthew L. Dailey <matthew.l.dailey@dartmouth.edu> Date: Sat Nov 22 15:24:16 2014 +0100 x2gocleansessions: Redirect stdin, stdout and stderr to /dev/null, test for the existence of the file descriptor before issuing the close, only capture the file descriptor backreference in the regex and send any close failures to syslog. (Fixes: #678). --- debian/changelog | 7 +++++++ x2goserver/sbin/x2gocleansessions | 24 +++++++++++------------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2b76639..65db5fd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -220,6 +220,13 @@ x2goserver (4.0.1.19-0x2go1) UNRELEASED; urgency=medium "x2gouser". + Add to BR: findutils. + [ Matthew L. Dailey ] + * New upstream version (4.0.1.19): + - x2gocleansessions: Redirect stdin, stdout and stderr to /dev/null, test + for the existence of the file descriptor before issuing the close, + only capture the file descriptor backreference in the regex and + send any close failures to syslog. (Fixes: #678). + -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Tue, 07 Oct 2014 15:35:38 +0200 x2goserver (4.0.1.18-0x2go1) unstable; urgency=medium diff --git a/x2goserver/sbin/x2gocleansessions b/x2goserver/sbin/x2gocleansessions index d785daf..f45640c 100755 --- a/x2goserver/sbin/x2gocleansessions +++ b/x2goserver/sbin/x2gocleansessions @@ -94,23 +94,21 @@ elsif ($pid == 0 ) # close any open file descriptor left open by our parent before the fork my $fd; for (glob "/proc/$$/fd/*") { - if ($_ =~ m/\/proc\/(\d+)\/fd\/(\d+)/) { - $fd = $2; - if ( $fd == 0 ) { next; } - if ( $fd == 1 ) { next; } - if (POSIX::close($fd)) { - print ""; - #print "Closed:II$_\n"; - } else { - print ""; - #print "Error Closing:I$_\n"; + if ( ! -e $_ ) { next; } + if ($_ =~ m/\/proc\/\d+\/fd\/(\d+)/) { + $fd = $1; + if ( $fd < 3 ) { next; } + if (! POSIX::close($fd)) { + syslog('warning', "Error Closing $_: $!"); } - } else { - print ""; - #print "ERROR: $_\n"; } } + # redirect stdin, stdout and stderr + open *STDIN, q{<}, '/dev/null'; + open *STDOUT, q{>>}, '/dev/null'; + open *STDERR, q{>>}, '/dev/null'; + $SIG{TERM}=\&catch_term; $SIG{CHLD} = sub { wait }; -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git