From: Kevin Cernekee Date: Sun, 28 Oct 2012 06:20:38 +0000 (-0700) Subject: Allow setting reported OS from the command line X-Git-Tag: v4.99~26^2~12 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c8be5eb6130e8d9510a1ceaf24a2680b7071ac2f;p=users%2Fdwmw2%2Fopenconnect.git Allow setting reported OS from the command line Signed-off-by: Kevin Cernekee --- diff --git a/main.c b/main.c index da696488..325ccd31 100644 --- a/main.c +++ b/main.c @@ -111,6 +111,7 @@ enum { OPT_NON_INTER, OPT_DTLS_LOCAL_PORT, OPT_STOKEN, + OPT_OS, }; #ifdef __sun__ @@ -175,6 +176,7 @@ static struct option long_options[] = { OPTION("non-inter", 0, OPT_NON_INTER), OPTION("dtls-local-port", 1, OPT_DTLS_LOCAL_PORT), OPTION("stoken", 2, OPT_STOKEN), + OPTION("os", 1, OPT_OS), OPTION(NULL, 0, 0) }; @@ -713,6 +715,13 @@ int main(int argc, char **argv) use_stoken = 1; token_str = keep_config_arg(); break; + case OPT_OS: + if (openconnect_set_reported_os(vpninfo, config_arg)) { + fprintf(stderr, _("Invalid OS identity \"%s\"\n"), + config_arg); + exit(1); + } + break; default: usage(); }