| Summary: | busybox nc segfaults with option -z | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | Andreas <lampersperger.andreas> |
| Component: | Networking | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | busybox-cvs, lampersperger.andreas |
| Priority: | P5 | ||
| Version: | 1.22.x | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
Thanks! Fixed in git: commit c472898eaa0ccc1d4d787ae1917a8f40d18889cb Author: Denys Vlasenko <vda.linux@googlemail.com> Date: Wed Feb 26 13:58:59 2014 +0100 nc: fix option bit positions |
You cannot use busybox nc with Option -z, because -z is mapped to -o, e.g. I used the following command, to test if there is a running ssh service on somehostname: busybox nc -w 2 -z somehostname 22 ; echo $? This fails with a segfaulting busybox. I tracked the error and found it was introduced with the commit de6f14800675cd0401106876da81da7618de71c6 (nc_bloaty: support -ll and -lk). Please apply the following patch to correct this error: Index: busybox-1.22.1/networking/nc_bloaty.c =================================================================== --- busybox-1.22.1.orig/networking/nc_bloaty.c +++ busybox-1.22.1/networking/nc_bloaty.c @@ -175,9 +175,9 @@ enum { OPT_w = (1 << 5), OPT_l = (1 << 6) * ENABLE_NC_SERVER, OPT_k = (1 << 7) * ENABLE_NC_SERVER, - OPT_i = (1 << (7+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA, - OPT_o = (1 << (8+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA, - OPT_z = (1 << (9+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA, + OPT_i = (1 << (6+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA, + OPT_o = (1 << (7+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA, + OPT_z = (1 << (8+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA, }; #define o_nflag (option_mask32 & OPT_n)