listen: increase the default backlog to 128Increase the default listenq to 128 (the standard max for most systems).
Values exceeding the system limit are truncated to the system max. The
behaviour of 0 and negative numbers is system dependent.
UNP says about the backlog:
Historically, sample code always shows a backlog of 5, as that was the
maximum value supported by 4.2BSD. This was adequate in the 1980s when
busy servers...
Correct check for character deviceThe procket helper will only open devices under the /dev directory.
Append "/dev/" to the device name for the permissions check.
examples/icmp: filter ICMP packetsWhen pinging localhost, the ICMP socket will see the echo request and
reply. Filter out the echo request. icmp:ping/2,1 will still crash on
other ICMP types.
Thanks @infospacer!
sendmsg/recvmsg; return the number of bytesReturn the number of bytes sent/received. The msghdr structure contains
a pointer to an iovec which may consist of several buffers. The sendmsg
and recvmsg NIFs are not aware of the size and number of the buffers.
Add support for sendmsg/recvmsgIn preparation for support of socket ancillary data (RFC3542, Unix
sockets, ...), add support for sendmsg(2) and recvmsg(2).
recvmsg/3 and sendmsg/3 require a struct msghdr to be prepared
containing pointers to allocated memory (to be read into and to be
read from respectively). This buffer will have to be allocated using
procket:alloc/1.
Figure out how to run procket setuid helperModify the way the procket external setuid helper binary is called based
on:
* whether a progname has explicitly been passed in (run the command
immediately)
* if the procket helper is setuid/setgid (run the command immediately)
* if a device is requested to be opened, check the access rights of the
process (if read/write, run command immediately)
* otherwise, use sudo
use sudo only when necessarytry sudo only when it seems necessary. i.e. when we actually got EACCES.
motivations:
- the use of sudo involves some side effects which might be undesirable.
for example, as sudo is a setuid binary, LD_PRELOAD is unset.
it makes difficult to use this with a rump kernel.
http://netbsd.gw.com/cgi-bin/man-cgi?rumphijack++NetBSD-current
- as priv/procket command can be used to open arbit...