[erlang-questions] prim_inet:accept() bug with {fd, N} socket option?

Serge Aleynikov saleyn@REDACTED
Mon Oct 8 14:08:48 CEST 2007


Per Hedeland wrote:
> Primarily the case where you need to bind a socket to a "privileged"
> port, but don't want to run the whole Erlang system as root. You can
> then (create and) bind the socket in an external process, and pass it to
> Erlang via sendmsg(2) and a driver. You could also have "inherited" the
> socket descriptor somehow, e.g. if you start Erlang via [x]inetd,
> stdin/out/err is a socket - this can also be a way to handle the
> privileged port case: Bind the socket in a setuid-root or root-started
> program that then setuid()s to an unprivileged uid and execs the Erlang
> runtime system.

Indeed.  For the setuid requirement I've been using Linux capability 
flags, but I do recall our former discussion and your rightful concern 
of portability issues with this approach.

> I converted the patch to match R11B-5, it was pretty trivial, but let me
> know if you want it (untested though).

Yes, please. Since I haven't applied it yet, I'd rather start with what 
you have for R11B-5 to begin with.

Regards,

Serge




More information about the erlang-questions mailing list