Problems listening on a privileged port
Problems listening on a privileged port
- Subject: Problems listening on a privileged port
- From: Kent Sorensen <email@hidden>
- Date: Tue, 2 Oct 2007 21:41:22 -0400
I need to listen for incoming connections on port 59. I am using the
MoreSecurity sample code from MoreIsBetter which has an example on how
to use a privileged helper tool to bind to a low numbered port.
This works fine, and I can get a filedesc back from the tool, but when
I try to do a listen() in my application, it fails with errno =
ENOTSOCK
I have verified that the value of the filedesc in the application is
the one that the tool returns.
If I do the listen() inside the privileged tool it succeeds, even if I
do it after the point where the non-privileged UID has been restored
I was under the impression that it was only bind() that was a protected
operation, but it appears that there's something (probably a lot) that
I don't understand about this problem.
Any information appreciated.
Thanks
Kent
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden