Fedora Account System
Red Hat Associate
Red Hat Customer
+++ This bug was initially created as a clone of Bug #1257549 +++ Description of problem: netstat tool does not throw any exit code other then 0. You can provide any input parameter and still get error code 0. Version-Release number of selected component (if applicable): net-tools-2.0-0.17.20131004git.el7.x86_64 How reproducible: Always Steps to Reproduce: 1. Issue any arbitrary parameter to netstat $ netstat --asd netstat: unrecognized option '--asd' usage: netstat [-vWeenNcCF] [<Af>] -r netstat {-V|--version|-h|--help} netstat [-vWnNcaeol] [<Socket> ...] netstat { [-vWeenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s [-6tuw] } [delay] -r, --route display routing table -I, --interfaces=<Iface> display interface table for <Iface> -i, --interfaces display interface table -g, --groups display multicast group memberships -s, --statistics display networking statistics (like SNMP) -M, --masquerade display masqueraded connections -v, --verbose be verbose -W, --wide don't truncate IP addresses -n, --numeric don't resolve names --numeric-hosts don't resolve host names --numeric-ports don't resolve port names --numeric-users don't resolve user names -N, --symbolic resolve hardware names -e, --extend display other/more information -p, --programs display PID/Program name for sockets -o, --timers display timers -c, --continuous continuous listing -l, --listening display listening server sockets -a, --all display all sockets (default: connected) -F, --fib display Forwarding Information Base (default) -C, --cache display routing cache instead of FIB -Z, --context display SELinux security context for sockets <Socket>={-t|--tcp} {-u|--udp} {-U|--udplite} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: inet List of possible address families (which support routing): inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25) netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP) x25 (CCITT X.25) 2. Observe the exit code $ echo $? 0 Actual results: Exit code is always 0 Expected results: Exit differs from 0 Additional info: In RHEL6 & net-tools-1.60-110.el6_2 I can see exit code "4" when provided given wrong input parameter. Also, this error is present in various distributions like Fedora 19, 22 and Gentoo net-tools-2.0-0.31.20141124git.fc22.x86_64 --- Additional comment from RHEL Product and Program Management on 2015-08-27 12:27:48 CEST --- Since this bug report was entered in bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
Created attachment 1072034 [details] Fix exit code (urecognized argument)
Tomáš & Michael: Can we use exit(E_USAGE); instead of usage(0); ? Also, can you create a patch against upstream git repo, so we can send it upstream ? $ git config --global user.name "John Doe" $ git config --global user.email johndoe $ git clone git://git.code.sf.net/p/net-tools/code net-tools $ cd net-tools apply your change $ git commit -am "netstat: Fix exit code (urecognized argument)" $ git format-patch HEAD~1 attach the 0001-*.patch thanks
Created attachment 1072083 [details] netstat: Fix exit code (unrecognized argument)
Merged upstream: sourceforge.net/p/net-tools/code/ci/adf6f5793fb74c723391a14efa8c2e4c7ef354f0
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions
net-tools-2.0-0.37.20160329git.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-b1e3346c50
net-tools-2.0-0.37.20160329git.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-b1e3346c50
net-tools-2.0-0.37.20160329git.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.