On Thursday 24 August 2006 08:42, Stephen Smalley wrote:
> > +static int get_context_from_socket(int fd, char *buffer, unsigned int
> > *buflen) +{
> > + const char *func = "get_context_from_socket" ;
> > +
> > + int retval = getsockopt(fd, SOL_SOCKET, SO_PEERSEC, buffer, buflen);
>
> libselinux provides a wrapper for this interface that internally handles
> size determination and allocation of the buffer, getpeercon(3).
Thanks for the review. You are right and that shortens up the patch, too.
Done.
BTW, this was only the first round of the patch to let people start doing some
testing. I have more code to add to do integrated checks to make sure the
config option makes sense after the whole service config has been parsed.
Will push a new xinetd package though the build system tonight, too.
> > + if (get_context_from_socket(fd, buffer, &buflen))
> > + return -1;
> > +
> > + int retval = setexeccon(buffer);
>
> Do you want to apply any kind of access checks on the peer context
> before using it, or are you entirely relying on the OS level checks to
> bound the client?
I was thinking that we should have some kind of range set by the admin applied
to the the listening socket. This way the OS can do some of the rejection
without causing xinetd to do work. Does this approach make sense?
Thanks,
-Steve
--
redhat-lspp mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/redhat-lspp