aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2019-12-03 22:28:19 +0100
committerHarald Welte <laforge@osmocom.org>2019-12-03 22:28:19 +0100
commitde67c001b78dfc08e8baa4b8e0ab7fe9ca1170b7 (patch)
tree62f0edeff174921e300e570929f17d298d825ab2 /src
parentad08d17e07f307fbb67492707017a3d5103f1683 (diff)
exit(2) on unsupported positional arguments on command lineHEADmaster
Diffstat (limited to 'src')
-rw-r--r--src/gbproxy/gb_proxy_main.c5
-rw-r--r--src/gtphub/gtphub_main.c5
-rw-r--r--src/sgsn/sgsn_main.c5
3 files changed, 15 insertions, 0 deletions
diff --git a/src/gbproxy/gb_proxy_main.c b/src/gbproxy/gb_proxy_main.c
index 4319fda6..8c839804 100644
--- a/src/gbproxy/gb_proxy_main.c
+++ b/src/gbproxy/gb_proxy_main.c
@@ -196,6 +196,11 @@ static void handle_options(int argc, char **argv)
break;
}
}
+
+ if (argc > optind) {
+ fprintf(stderr, "Unsupported positional arguments on command line\n");
+ exit(2);
+ }
}
int gbproxy_vty_is_config_node(struct vty *vty, int node)
diff --git a/src/gtphub/gtphub_main.c b/src/gtphub/gtphub_main.c
index f693f099..664c801e 100644
--- a/src/gtphub/gtphub_main.c
+++ b/src/gtphub/gtphub_main.c
@@ -322,6 +322,11 @@ static void handle_options(struct cmdline_cfg *ccfg, int argc, char **argv)
break;
}
}
+
+ if (argc > optind) {
+ fprintf(stderr, "Unsupported positional arguments on command line\n");
+ exit(2);
+ }
}
int main(int argc, char **argv)
diff --git a/src/sgsn/sgsn_main.c b/src/sgsn/sgsn_main.c
index 7d9a8511..3b18b051 100644
--- a/src/sgsn/sgsn_main.c
+++ b/src/sgsn/sgsn_main.c
@@ -271,6 +271,11 @@ static void handle_options(int argc, char **argv)
break;
}
}
+
+ if (argc > optind) {
+ fprintf(stderr, "Unsupported positional arguments on command line\n");
+ exit(2);
+ }
}
/* default categories */