From 6806ae4a850fc7785a8c05304237cf53b5b8f951 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 23 Dec 2016 13:12:09 +0100 Subject: merge with latest dev version (tm-scripts commit f5a59daf8d70a9027118292cd40b18c221897408) --- core/modules/run-virt/fwtool/main.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 core/modules/run-virt/fwtool/main.c (limited to 'core/modules/run-virt/fwtool') diff --git a/core/modules/run-virt/fwtool/main.c b/core/modules/run-virt/fwtool/main.c new file mode 100644 index 00000000..9e272384 --- /dev/null +++ b/core/modules/run-virt/fwtool/main.c @@ -0,0 +1,32 @@ +#define _GNU_SOURCE +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + if (argc < 2) { + puts("Nee\n"); + return 1; + } + char * const nargv[] = { + "bash", + "/opt/openslx/vmchooser/scripts/set-firewall", + argv[1], + 0 + }; + char * const nenv[] = { + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/sbin:/opt/openslx/bin", + "HOME=/root", + "LC_ALL=C", + "LANG=C", + 0 + }; + + setresuid(0, 0, 0); + setregid(0, 0); + + execve("/bin/bash", nargv, nenv); +} + -- cgit v1.2.3-55-g7522