diff options
author | Simon Rettberg | 2024-10-23 15:36:08 +0200 |
---|---|---|
committer | Simon Rettberg | 2024-10-23 15:36:08 +0200 |
commit | 024d9eaa0c5f7675585e1cde1b4639cc62bf439e (patch) | |
tree | df2f16265fe54a1afaba762fd655c8557e3e1146 /core/modules/run-virt/fwtool/main.c | |
parent | [run-virt] Remove stray else (diff) | |
download | mltk-024d9eaa0c5f7675585e1cde1b4639cc62bf439e.tar.gz mltk-024d9eaa0c5f7675585e1cde1b4639cc62bf439e.tar.xz mltk-024d9eaa0c5f7675585e1cde1b4639cc62bf439e.zip |
[run-virt] Fix DNS blocking
Diffstat (limited to 'core/modules/run-virt/fwtool/main.c')
-rw-r--r-- | core/modules/run-virt/fwtool/main.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/core/modules/run-virt/fwtool/main.c b/core/modules/run-virt/fwtool/main.c index aa6e70f3..f7d5b120 100644 --- a/core/modules/run-virt/fwtool/main.c +++ b/core/modules/run-virt/fwtool/main.c @@ -4,20 +4,27 @@ #include <sys/types.h> #include <unistd.h> +#define MAXARGS 10 + int main(int argc, char **argv) { if (argc < 2) { puts("Nee\n"); return 1; } - char * const nargv[] = { + char* vnargv[MAXARGS] = { "bash", "/opt/openslx/vmchooser/scripts/set-firewall", - argv[1], - 0 }; + for (int i = 1; i < MAXARGS - 2; ++i) { + vnargv[i+1] = argv[i]; + if (argv[i] == 0) + break; + } + vnargv[MAXARGS - 1] = 0; + char * const * nargv = vnargv; char * const nenv[] = { - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/sbin:/opt/openslx/bin", + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/openslx/sbin:/opt/openslx/bin", "HOME=/root", "LC_ALL=C.UTF-8", "LANG=C.UTF-8", |