pcp
[Top] [All Lists]

Re: [pcp] PCP Updates: PMCD Host Access Control for Unix Domain Sockets

To: Dave Brolley <brolley@xxxxxxxxxx>
Subject: Re: [pcp] PCP Updates: PMCD Host Access Control for Unix Domain Sockets
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Tue, 27 Aug 2013 18:54:37 -0400 (EDT)
Cc: PCP <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <521D0032.7050604@xxxxxxxxxx>
References: <521B9981.3010103@xxxxxxxxxx> <948387283.6616725.1377588394665.JavaMail.root@xxxxxxxxxx> <521D0032.7050604@xxxxxxxxxx>
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>
Thread-index: oHk/DHv3J3EZRtDakySZYsSB1V4YFg==
Thread-topic: PCP Updates: PMCD Host Access Control for Unix Domain Sockets

----- Original Message -----
> ...
> I've review the code that you reference here and it makes sense to me.
> Stay tuned for an update.
> ...
> Yeah. It ignores non-inet addresses completely. Should be easy to bring
> it up to speed.

Fabulous, x2 - thanks!  I'll go add mention of pmContextGetHostName() to
the Programmers Guide as well, and update the man page to discuss use of
the pmcd.hostname metric.

> The problem I see is that the address path must be set after __pmAccept
> (that's when we find out it's AF_UNIX) and by the time we return to
> __pmServerAddNewClients, it's too late (do we even have access to the
> client's address from within __pmServerAddNewClients?). The access check
> (__pmAccAddClient) is done by CheckNewClient immediately after
> AcceptNewClient.

*nod* - you're right, we don't even (can't possibly) have the addr pointer
in the CheckNewClient callback.

> The only place I see to do this within libpcp would be within __pmAccept
> itself, which would be nice, since this code is intended to fill in the
> address for AF_UNIX clients (accept(3) and PR_Accept() don't do this for
> some reason although, by design, they do it for other address families).
> However, then there would be an assumption within __pmAccept that only
> one unix domain socket client exists for each server, which may or may
> not be a problem.

I don't think that's a problem - there's already assumptions in the libpcp
code that theres only one localSocketFd/Path isn't there?  __pmAccept gets
my vote, if that can be made to work.

cheers.

--
Nathan

<Prev in Thread] Current Thread [Next in Thread>