Commit Graph

28 Commits

Author SHA1 Message Date
Mike Frysinger e0fbe7aea4 add netcat manpage 2018-01-11 03:38:32 -05:00
Mike Frysinger af2ec70280 support named ports with dashes in them
Normally netcat treats dashes as port ranges (e.g. "ssh-http"), but
there are port names with dashes in them (e.g. "ftp-data").  Allow
users to escape the dashes to support the latter mode.
2018-01-11 03:24:37 -05:00
Mike Frysinger 3807536449 add IPv6 patch 2018-01-10 23:57:00 -05:00
Mike Frysinger 9274c7d458 add a -q option for controlling automatic exit behavior 2018-01-11 03:44:26 +00:00
Mike Frysinger 3c58093fdc add a -b option to allow sending to broadcast addresses 2018-01-11 03:38:27 +00:00
Mike Frysinger 5236e1513f change inet_addr to inet_aton
The former cannot differentiate between errors (-1) and 255.255.255.255.
Switch to inet_aton which does not have this problem.
2018-01-11 03:32:05 +00:00
Mike Frysinger c037092c97 drop "punt" message when using CTRL+C
Most distros have patched this out, so might as well do it here too.
2018-01-11 03:20:55 +00:00
Mike Frysinger 84f88ce209 drop default stripping
If people want to strip this, they can do so via `strip`.
2018-01-11 03:14:41 +00:00
George Burgess IV 74922ad47b Fix the size of a strncpy
It seems that the intent of this code was to only use the first char[24]
in `addrs` for this strncpy. While that should always happen anyway
(inet_ntoa should never produce a >= 24 char string), the mismatch
between the size of poop->addrs[0] and `sizeof(poop->addrs)` caused
issues with FORTIFY on clang.
2018-01-05 23:12:30 +00:00
Mike Frysinger 31f56e021f fix crashes with large port numbers
the anum field isn't used anywhere, so punt it

http://bugs.gentoo.org/370827
2011-06-12 01:42:11 +00:00
Mike Frysinger fcaf538746 add an -c option which is like -e but executes through a shell 2009-03-06 02:51:18 +00:00
Mike Frysinger bda7ada5a1 do not make the -n flag affect service name lookups 2009-03-06 02:45:46 +00:00
Mike Frysinger 417a3d26a0 add an option to use sig{set,long}jmp and default it to on for linux systems 2009-03-06 02:41:40 +00:00
Mike Frysinger e670149ab9 rename the arm() func to arm_timer() as gcc arm compilers define "arm" by default 2009-03-06 02:35:22 +00:00
Mike Frysinger 5d9df913c4 define HAVE_SOCKLEN_T for linux systems 2009-03-06 02:32:41 +00:00
Mike Frysinger 36d74baf20 use __linux__ rather than LINUX as toolchains set that up automatically 2009-03-06 02:13:34 +00:00
Mike Frysinger b9e72ce5af dump usage() info to stdout when asking for help 2009-03-06 02:11:45 +00:00
Mike Frysinger 69a0d44d75 make sure the buffer holding the command line is always NUL terminated 2009-03-06 02:10:10 +00:00
Mike Frysinger ebf4d38912 dont delay with sleep() before calling exit() 2009-03-06 01:55:09 +00:00
Mike Frysinger 9059d5da39 mmm, actually allow HAVE_BIND on all systems and use resolv.h on linux systems 2009-03-06 01:51:34 +00:00
Mike Frysinger e89203975b declare proper return types for funcs and move helpme() up before its first usage 2009-03-06 01:46:51 +00:00
Mike Frysinger b7c6c3c10e use socklen_t with network functions 2009-03-06 01:42:41 +00:00
Mike Frysinger 89659d87d9 include unistd.h for some standard file related prototypes 2009-03-06 01:35:04 +00:00
Mike Frysinger 384a321928 include time.h by default for time() prototype 2009-03-06 01:32:40 +00:00
Mike Frysinger d0ec781df1 do not define HAVE_BIND by default -- let builders do it 2009-03-06 01:28:37 +00:00
Mike Frysinger 3d5a4955ad remove embedded /* in comments 2009-03-06 01:21:49 +00:00
Mike Frysinger 7ed164285c document our role 2007-01-18 04:06:44 +00:00
Anatoly Techtonik 5086ba1ade *Hobbit*'s netcat 1.10 2007-01-17 09:51:02 +00:00