summaryrefslogtreecommitdiff
path: root/src/usr.bin/nc (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Add missing colon after "Peer name" in verbose output. Mentioned on themmcc2015-12-171-2/+2
| | | | lists recently.
* clean up some unused variables, and add the printing of the certificate validitybeck2015-12-161-4/+7
| | | | | to the verbose output when using tls - from rob@2keys.ca ok mmcc@ jsing@ deraadt@
* Specify SOCKS version in error messages. ok deraadt@mmcc2015-12-101-3/+3
|
* Map SOCKS error codes to error strings. With input from deraadt@mmcc2015-12-101-5/+61
|
* pledge nc better - Load the certificate into memory and then do the pledge,beck2015-12-081-5/+21
| | | | | this allows us to drop the rpath fromt the nc pledge. ok deraadt@, tedu@
* Get rid of modulo bias and replace the naive shuffle by thetb2015-12-071-20/+16
| | | | | | | | Knuth-Fisher-Yates shuffle to make the random sequence of ports less biased. Based on the implementation in sys/netinet/ip_id.c. With helpful input from daniel@ and beck@ ok beck@ despite eye twitching
* rename variable 'sun' to allow building on Solarisbcook2015-11-231-13/+13
| | | | ok deraadt@
* Since rtable was hoisted to the top with setrtable, it should have noderaadt2015-11-131-10/+7
| | | | | bearing on the following pledge setups anymore. ok benno
* with -V argument, dont set rtable on the socket, instead set if for the wholebenno2015-11-121-15/+4
| | | | | | | | | process, before pledge(). This way the rtable can be pledged too. the discussion about removing -V is postponed. diff from beck@, i wrote the same diff without seeing his, and various people at u2k15 agreed this is the right thing to do. ok phessler@
* KNF; from Rob Piercederaadt2015-11-011-3/+3
|
* Initial pledge of netcat - unfortunately flawed because fiddling the rtableidbeck2015-10-231-1/+27
| | | | | | | in a socket option can be pretty scary and there is no better interface for this. so if the -V option is used you get no pledge at all.. Otherwise, do what works for the various options. Still needs refinement for tls to drop rpath, and a better solution for the routing table stuff
* Userspace doesn't need to use SUN_LEN(): connect() and bind() must acceptguenther2015-10-111-8/+3
| | | | | | sizeof(struct sockaddr_un), so do the simple, portable thing ok beck@ deraadt@
* avoid trailing .Ns, reduce .Xo and .Sm, drop redundant .Bkschwarze2015-09-251-12/+4
|
* display negotiated TLS version and cipher suite in verbose mode.beck2015-09-131-2/+3
| | | | ok jsing@
* Adapt to just committed libtls api changebeck2015-09-121-21/+14
|
* use SOCK_CLOEXEC instead of fnctl; ok guenther beck jsingderaadt2015-09-121-12/+16
|
* fix previous;jmc2015-09-122-31/+48
|
* spaces found during a readderaadt2015-09-111-19/+18
|
* Add TLS suppport to nc. Provides a useful little test and script tool.beck2015-09-113-45/+346
| | | | ok jsing@ bluhm@
* Netcat could hang during write(2) although poll(2) reports that thebluhm2015-09-081-15/+6
| | | | | | | | | socket is writeable. This happens because netcat tries to write more than the low water mark of the socket write buffer. With a non-blocking socket you may get a short write, otherwise it blocks. The latter could cause a total hang of the netcat process depending on the upper protocol. So make the network connection non-blocking. OK claudio@ millert@
* synchronize synopsis and usage.sobrado2015-09-031-2/+2
|
* remove unused variablechl2015-07-261-2/+2
| | | | ok tedu@
* The code in socks.c writes multiple times in a row to a socket. If thetobias2015-03-261-3/+6
| | | | | | | | | socket becomes invalid between these calls (e.g. connection closed), write will throw SIGPIPE. With this patch, SIGPIPE is ignored so we can handle write's -1 return value (errno will be EPIPE). Ultimately, it leads to program exit, too -- but with nicer error message. :) with input by and ok djm
* Fix error message in case of write failure.tobias2015-03-261-3/+3
| | | | ok djm
* Check for short writes in fdpass(). Clean up while at it.tobias2015-03-261-4/+3
| | | | ok djm
* Sync camel case of "ProxyUseFdpass" with ssh_config(5).tobias2015-03-261-3/+3
| | | | ok djm
* Support for nc -T on IPv6 addresses.jca2015-02-141-7/+16
| | | | ok sthen@
* my mistake. we already did increase buffers to 16k; increasing to 64ktedu2014-10-301-2/+2
| | | | would be the next stage of embiggening. restore 16k.
* rework the poll loop to poll in both directions so it doesn't get stucktedu2014-10-301-47/+211
| | | | | if one pipe stalls out. from a diff by Arne Becker. (buffer size left alone for now)
* POLLIN is not guaranteed to be set in revents for EOF so check formillert2014-10-261-3/+3
| | | | POLLHUP too. OK deraadt@
* Remove unnecessary include: netinet/in_systm.h is not needed by theselteo2014-10-241-2/+1
| | | | | | programs. ok deraadt@ millert@
* Make sure the correct errno is reported by warn* or err* and notguenther2014-07-201-2/+3
| | | | | | the errno of an intervening cleanup operation like close/unlink/etc. Diff from Doug Hogan (doug (at) acyclic.org)
* stick with 16k buffers for a little while to avoid bufferbloat.tedu2014-06-101-2/+2
| | | | | atomicio writing out 64k in one direction will cause traffic in the other direction to stall until it's complete. discussion with deraadt
* increase buffer size to 64k, and actually use it. ok deraadttedu2014-06-101-3/+3
| | | | from John-Mark Gurney
* Use errc/warnc to simplify code.guenther2014-05-201-2/+2
| | | | | | Also, in 'ftp', always put the error message last, after the hostname/ipaddr. ok jsing@ krw@ millert@
* Unbreak nc -6 -l. Don't retrieve and thus later set the routing tablejca2014-03-121-3/+2
| | | | | unless -V is passed (intent of the previous commit), and use SOL_SOCKET instead of IPPROTO_IP to set the rtable in local_listen(). ok sthen@
* Once more, the default routing table id is inherited from the processclaudio2014-02-261-3/+2
| | | | like for any other process as well. OK by many
* one of the examples needs -N to work again;jmc2014-02-101-3/+3
| | | | | | | the paper trail appears to be: reported in feebsd pr docs/185353 by rol robert-eckardt de fix suggested by peter wemm diff submitted to tech by allan jude
* Only use setsockopt(..SO_RTABLE..) if the -V flag is given to nc/telnet,sthen2013-10-261-7/+7
| | | | | same style as traceroute6 (change to int and use -1 as a flag, so rtable 0 can still be used as an explicit parameter).
* Oups, a little bit overzealous. If we "route -T4 exec telnet foo", thenphessler2013-10-211-1/+2
| | | | make sure telnet runs in rdomain 4 as expected. Same for nc.
* Set the requested rdomain on the socket instead of only on the IPv4 part.phessler2013-10-211-11/+7
| | | | Also, switching to rdomain zero is a legit option so we should allow that.
* escape not-full-stop-dot at eol;jmc2013-08-201-2/+2
|
* add -F to usage() and help();jmc2013-08-201-2/+3
| | | | ok djm
* add -F flag to enabled fd-pass mode: establish connection and passdjm2013-08-202-6/+89
| | | | | | connected socket to stdout. This is useful in proxy mode to establish a connection for use by ssh in conjunction with its new ProxyUseFDPass option; ok markus@
* use .Mt for email addresses; from Jan Stary <hans at stare dot cz>; ok jmc@schwarze2013-07-161-4/+4
|
* use FD_CLOEXEC instead of 1; from David Hillokan2013-04-291-2/+2
| | | | ok otto
* Don't shutdown nc(1)'s network socket when stdin closes. Matches *Hobbit*'ssthen2013-03-202-7/+17
| | | | | | original netcat and GNU netcat; revert to old behaviour with the new -N flag if needed. After much discussion with otto deraadt tedu and Martin Pelikan. ok deraadt@
* All accept() errors are considered fatal, until someone gives a differentderaadt2013-03-121-4/+5
| | | | reason. No code changed, just documenting it...
* remove some unnecessary sys/param.h inclusionsderaadt2012-12-041-3/+1
|
* Allow UDP server to receive datagrams from multiple socket pairs with -khaesbaert2012-07-072-7/+17
| | | | | | | flag. Prompted by a question from dsp at 2f30 dot org, diff from Lazarom Koromil with a few tweaks by me, many thanks. ok mikeb@ nicm@ haesbaert@