This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
laforge gerrit-no-reply at lists.osmocom.orglaforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/16447 )
Change subject: exit(2) on unsupported positional arguments on command line
......................................................................
exit(2) on unsupported positional arguments on command line
Change-Id: I3b8781e220326387f1c437c39aff8661326f1e0a
---
M src/ipaccess/ipaccess-proxy.c
M src/osmo-bsc/osmo_bsc_main.c
M src/utils/bs11_config.c
3 files changed, 13 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, approved
diff --git a/src/ipaccess/ipaccess-proxy.c b/src/ipaccess/ipaccess-proxy.c
index 3d5f301..f4d620b 100644
--- a/src/ipaccess/ipaccess-proxy.c
+++ b/src/ipaccess/ipaccess-proxy.c
@@ -1200,6 +1200,10 @@
break;
}
}
+ if (argc > optind) {
+ fprintf(stderr, "Unsupported positional arguments on command line\n");
+ exit(2);
+ }
if ((options_mask & (IPA_PROXY_OPT_LISTEN_IP | IPA_PROXY_OPT_BSC_IP))
!= (IPA_PROXY_OPT_LISTEN_IP | IPA_PROXY_OPT_BSC_IP)) {
printf("ERROR: You have to specify `--listen' and `--bsc' "
diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index b18172c..6b14279 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -171,6 +171,11 @@
break;
}
}
+
+ if (argc > optind) {
+ fprintf(stderr, "Unsupported positional arguments on command line\n");
+ exit(2);
+ }
}
/* Callback function for NACK on the OML NM */
diff --git a/src/utils/bs11_config.c b/src/utils/bs11_config.c
index 2a2340c..7cd4203 100644
--- a/src/utils/bs11_config.c
+++ b/src/utils/bs11_config.c
@@ -854,6 +854,10 @@
if (optind+1 < argc)
value = argv[optind+1];
}
+ if (optind+2 < argc) {
+ fprintf(stderr, "Unsupported positional arguments on command line\n");
+ exit(2);
+ }
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/16447
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I3b8781e220326387f1c437c39aff8661326f1e0a
Gerrit-Change-Number: 16447
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191204/c35f691a/attachment.htm>