This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2gobroker. commit ce8b512f0291137e2ed997202bbce5040f754441 Author: Mihai Moldovan <ionic@ionic.de> Date: Tue Nov 13 15:40:34 2018 +0100 src/x2gobroker-{agent,ssh}.c: catch errors in setuid wrappers and add general return clause to make compilers happy. --- debian/changelog | 2 ++ src/x2gobroker-agent.c | 18 ++++++++++++++++-- src/x2gobroker-ssh.c | 17 +++++++++++++++-- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index f7db306..9e2dbfa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -117,6 +117,8 @@ x2gobroker (0.0.4.0-0x2go1) UNRELEASED; urgency=medium [ Mihai Moldovan ] * New upstream version (0.0.4.0): + - src/x2gobroker-{agent,ssh}.c: catch errors in setuid wrappers and add + general return clause to make compilers happy. * x2gobroker.spec: - Add %debug_package macro when debugging is to be enabled, hoping that it will actually generate proper debuginfo (and -source) sub packages diff --git a/src/x2gobroker-agent.c b/src/x2gobroker-agent.c index be88f60..45f908a 100644 --- a/src/x2gobroker-agent.c +++ b/src/x2gobroker-agent.c @@ -20,13 +20,27 @@ */ #include <unistd.h> +#include <stdlib.h> +#include <errno.h> +#include <stdio.h> int main( int argc, char *argv[] ) { - char x2gobrokeragent[] = TRUSTED_BINARY; argv[0] = "x2gobroker-agent.pl"; // execute the script, running with user-rights of this binary - execv(x2gobrokeragent, argv); + int ret = execv(x2gobrokeragent, argv); + int saved_errno = errno; + + if (ret) { + fprintf (stderr, "unable to execute script '"); + fprintf (stderr, TRUSTED_BINARY); + fprintf (stderr, "': "); + fprintf (stderr, strerror (saved_errno)); + + return (EXIT_FAILURE); + } + /* Should not be reached. */ + return (EXIT_SUCCESS); } diff --git a/src/x2gobroker-ssh.c b/src/x2gobroker-ssh.c index 1e7786b..14554a7 100644 --- a/src/x2gobroker-ssh.c +++ b/src/x2gobroker-ssh.c @@ -20,13 +20,26 @@ */ #include <unistd.h> +#include <stdlib.h> +#include <errno.h> +#include <stdio.h> int main( int argc, char *argv[] ) { - char x2gobrokerssh[] = TRUSTED_BINARY; argv[0] = "x2gobroker"; // execute the script, running with user-rights of this binary - execv(x2gobrokerssh, argv); + int ret = execv(x2gobrokerssh, argv); + + if (ret) { + fprintf (stderr, "unable to execute script '"); + fprintf (stderr, TRUSTED_BINARY); + fprintf (stderr, "': "); + fprintf (stderr, strerror (saved_errno)); + + return (EXIT_FAILURE); + } + /* Should not be reached. */ + return (EXIT_SUCCESS); } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git