From e453c7d73bf911860f30fd5031334aa3f10861c8 Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Mon, 4 Oct 2021 22:52:59 +1300 Subject: [PATCH] vncserver: swallow -interface and pass through to Xvnc --- unix/vncserver | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/unix/vncserver b/unix/vncserver index 1058bfd..8c234a7 100755 --- a/unix/vncserver +++ b/unix/vncserver @@ -957,11 +957,24 @@ sub ConstructXvncCmd { foreach $arg (@ARGV) { $cmd .= " " . "edString($arg); } + + $cmd .= SwallowedArgs(); + $cmd .= " >> " . "edString($desktopLog) . " 2>&1"; return $cmd; } +sub SwallowedArgs { + my $cmd; + + if ($opt{"-interface"}) { + $cmd .= " " . "-interface " . "edString($opt{"-interface"}); + } + + $cmd; +} + sub StartXvncAndRecordPID { system("$cmd & echo \$! >$pidFile"); } @@ -1085,7 +1098,7 @@ sub DefineFilePathsAndStuff { } sub ParseAndProcessCliOptions { - my @supportedOptions = ("-geometry",1,"-depth",1,"-pixelformat",1,"-name",1,"-kill",1,"-help",0,"-h",0,"--help",0,"-fp",1,"-list",0,"-fg",0,"-autokill",0,"-noxstartup",0,"-xstartup",1,"-select-de",OPTIONAL_ARG_VALUE); + my @supportedOptions = ("-geometry",1,"-depth",1,"-pixelformat",1,"-name",1,"-kill",1,"-help",0,"-h",0,"--help",0,"-fp",1,"-list",0,"-fg",0,"-autokill",0,"-noxstartup",0,"-xstartup",1,"-select-de",OPTIONAL_ARG_VALUEi, "-interface", REQUIRED_ARG_VALUE); &ParseOptionsAndRemoveMatchesFromARGV(@supportedOptions); &ProcessCliOptions(); &CheckGeometryAndDepthAreSensible();