[distcc] masquerade confusion

Wayne Davison wayned at users.sourceforge.net
Tue Mar 11 08:20:36 GMT 2003

On Tue, Mar 11, 2003 at 05:16:27PM +1100, Martin Pool wrote:
> I've just had a bit of confusion caused by ccache being installed as
> cc on the path of a distccd instance.  distccd had been started as
> root, and therefore ccache was trying to write to /root/.ccache, when
> running as user distcc.  

Just to be clear here, we're not talking about the recently-added distcc
masquerade support, but the presence of the ccache masquerade links on
the PATH when distccd was started (the recursion changes that were in
the masquerade patch handle the case where distccd accidentally calls

One possible way to improve this is to check the PATH when distccd
starts up.  It could search down the path checking if "cc" is a symlink
for "distcc" and/or "ccache" and trim off all the dirs up through the
last masquerade dir we find.  (Seems a bit kludgey, but this might be
better than nothing.)

If we go this route or not, I'd also suggest adding support to distccd
for an environment variable named DISTCCD_PATH that would be used to set
the PATH that distccd will use when running.  This would allow a power
user to include the ccache masquerade dir in the PATH (if desired), or
for any other custom PATH to be preconfigured in the user's rc file and
used for all distccd commands that get started.

Here's a patch that implements this idea:


See if you like it.


More information about the distcc mailing list