Re: nc -U -u (Unix datagram socket support)

2011-01-10 Thread Theo de Raadt
That looks good. .Fn mktemp was marked as a legacy interface in -.St -p1003.1-2001 -and may be removed in a future release of -.Ox . +.St -p1003.1-2001 . That looks good too. I think that whoever wrote that saw smoking something. No, that is completely accurate.

Re: nc -U -u (Unix datagram socket support)

2011-01-09 Thread Jeremy Evans
jmc@ and I discussed these man page changes. He's OK with this patch, but would like another network developer to approve. So, looking for OKs. Jeremy Index: nc.1 === RCS file: /cvs/src/usr.bin/nc/nc.1,v retrieving revision 1.56

Re: nc -U -u (Unix datagram socket support)

2011-01-09 Thread Nicholas Marriott
Not sure I count as a network developer but this looks fine to me. On Sun, Jan 09, 2011 at 01:15:51PM -0800, Jeremy Evans wrote: jmc@ and I discussed these man page changes. He's OK with this patch, but would like another network developer to approve. So, looking for OKs. Jeremy Index:

Re: nc -U -u (Unix datagram socket support)

2011-01-07 Thread Nicholas Marriott
On Thu, Jan 06, 2011 at 03:32:17PM -0800, Jeremy Evans wrote: This patch adds unix datagram socket support to nc(1). It's basically the same patch I sent last June (see http://marc.info/?l=openbsd-techm=127627296925965w=2), but updated for -current. Tested on amd64. Doesn't appear to

Re: nc -U -u (Unix datagram socket support)

2011-01-07 Thread Jeremy Evans
On 01/07 09:31, Nicholas Marriott wrote: On Thu, Jan 06, 2011 at 03:32:17PM -0800, Jeremy Evans wrote: This patch adds unix datagram socket support to nc(1). It's basically the same patch I sent last June (see http://marc.info/?l=openbsd-techm=127627296925965w=2), but updated for

Re: nc -U -u (Unix datagram socket support)

2011-01-07 Thread Nicholas Marriott
On Fri, Jan 07, 2011 at 08:48:20AM -0800, Jeremy Evans wrote: On 01/07 09:31, Nicholas Marriott wrote: On Thu, Jan 06, 2011 at 03:32:17PM -0800, Jeremy Evans wrote: This patch adds unix datagram socket support to nc(1). It's basically the same patch I sent last June (see

Re: nc -U -u (Unix datagram socket support)

2011-01-07 Thread Jeremy Evans
On 01/07 06:21, Nicholas Marriott wrote: On Fri, Jan 07, 2011 at 08:48:20AM -0800, Jeremy Evans wrote: On 01/07 09:31, Nicholas Marriott wrote: On Thu, Jan 06, 2011 at 03:32:17PM -0800, Jeremy Evans wrote: This patch adds unix datagram socket support to nc(1). It's basically the

Re: nc -U -u (Unix datagram socket support)

2011-01-07 Thread Jeremy Evans
On 01/07 07:31, Nicholas Marriott wrote: On Fri, Jan 07, 2011 at 10:52:18AM -0800, Jeremy Evans wrote: On 01/07 06:21, Nicholas Marriott wrote: Two further minor comments: - Can the mktemp buffer be on the stack rather than malloc()d? Sure. - I think the man page should mention it

Re: nc -U -u (Unix datagram socket support)

2011-01-07 Thread Jason McIntyre
On Fri, Jan 07, 2011 at 12:13:43PM -0800, Jeremy Evans wrote: Index: nc.1 === RCS file: /cvs/src/usr.bin/nc/nc.1,v retrieving revision 1.55 diff -u -p -r1.55 nc.1 --- nc.1 25 Jul 2010 07:51:39 - 1.55 +++ nc.1

Re: nc -U -u (Unix datagram socket support)

2011-01-07 Thread Nicholas Marriott
On Fri, Jan 07, 2011 at 01:03:19PM -0700, Theo de Raadt wrote: Well, I'm less worried about security and also about the fact mktemp is deprecated so I don't think adding new uses of it is not ideal. mktemp(3) is not deprecated. It continues to be safe to use for directory creation or

Re: nc -U -u (Unix datagram socket support)

2011-01-07 Thread Theo de Raadt
Fair enough. The man page seems a bit over strong, how about this? Index: mktemp.3 === RCS file: /cvs/src/lib/libc/stdio/mktemp.3,v retrieving revision 1.45 diff -u -p -r1.45 mktemp.3 --- mktemp.3 27 Dec 2010 21:18:44 -

Re: nc -U -u (Unix datagram socket support)

2011-01-07 Thread Joerg Sonnenberger
On Fri, Jan 07, 2011 at 01:32:27PM -0700, Theo de Raadt wrote: I think it is important that people who do use mktemp(3) realize that they must loop over failure (creating a new path each time), and they need to use a do not use the path from elsewhere unless the code that opens it returns

Re: nc -U -u (Unix datagram socket support)

2011-01-07 Thread Theo de Raadt
It is also important that the caller provides enough XXX to actually have a chance to finish the loop against a motivated concurrent user, especially when using something like /tmp. For us that is not really a problem since our mktemp is using 63 possibilities per slot. Stem selection remains

Re: nc -U -u (Unix datagram socket support)

2011-01-07 Thread Nicholas Marriott
On Fri, Jan 07, 2011 at 01:32:27PM -0700, Theo de Raadt wrote: So there is a mkdtemp(), but where is the AF_UNIX version? Well it wouldn't be big thing to add but from a quick look it seems like nc would be the only user. I think it is important that people who do use mktemp(3) realize that

Re: nc -U -u (Unix datagram socket support)

2011-01-07 Thread Nicholas Marriott
ok nicm, but you should save jmc the effort and trim the lines you left with trailing spaces in the man page ;-). On Fri, Jan 07, 2011 at 12:13:43PM -0800, Jeremy Evans wrote: On 01/07 07:31, Nicholas Marriott wrote: On Fri, Jan 07, 2011 at 10:52:18AM -0800, Jeremy Evans wrote: On 01/07

nc -U -u (Unix datagram socket support)

2011-01-06 Thread Jeremy Evans
This patch adds unix datagram socket support to nc(1). It's basically the same patch I sent last June (see http://marc.info/?l=openbsd-techm=127627296925965w=2), but updated for -current. Tested on amd64. Doesn't appear to cause any regressions to existing support, tested with unix stream and

Re: nc -U -u (Unix datagram socket support)

2011-01-06 Thread Ted Unangst
On Thu, Jan 6, 2011 at 6:32 PM, Jeremy Evans jer...@openbsd.org wrote: This patch adds unix datagram socket support to nc(1). It's basically the same patch I sent last June (see http://marc.info/?l=openbsd-techm=127627296925965w=2), but updated for -current. Tested on amd64. Doesn't appear

Re: nc -U -u (Unix datagram socket support)

2011-01-06 Thread Jeremy Evans
On 01/06 07:07, Ted Unangst wrote: On Thu, Jan 6, 2011 at 6:32 PM, Jeremy Evans jer...@openbsd.org wrote: This patch adds unix datagram socket support to nc(1). ?It's basically the same patch I sent last June (see http://marc.info/?l=openbsd-techm=127627296925965w=2), but updated for

Re: nc -U -u (Unix datagram socket support)

2011-01-06 Thread Ted Unangst
On Thu, Jan 6, 2011 at 7:19 PM, Jeremy Evans jer...@openbsd.org wrote: I believe that for unix stream sockets, you don't need to have a sending socket file created, while you do for datagram sockets, as otherwise you can't have a bidirectional connection. I have no problem with always using a

Re: nc -U -u (Unix datagram socket support)

2011-01-06 Thread Jeremy Evans
On 01/06 08:56, Ted Unangst wrote: On Thu, Jan 6, 2011 at 7:19 PM, Jeremy Evans jer...@openbsd.org wrote: I believe that for unix stream sockets, you don't need to have a sending socket file created, while you do for datagram sockets, as otherwise you can't have a bidirectional connection.