GwenNelson / distcc

Automatically exported from code.google.com/p/distcc
GNU General Public License v2.0
0 stars 0 forks source link

pump breaks distcc masquerading #110

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
pump sets PATH=$distcc_location:$PATH unconditionally. this breaks masquerading 
if we have $distcc_location != $masquerade_location, which is the common case.

please leave $PATH to the user or provide an option. thanks for the great work.

Original issue reported on code.google.com by bsun....@gmail.com on 7 May 2012 at 4:24

GoogleCodeExporter commented 9 years ago
A little bit more detail on the issue:

As far as I can see from the history, the code setting the PATH has always been 
this way. As for the variable $masquerade_location, it either no longer exists 
or was used by the OP as an example. $distcc_location is set from the 
environment variable DISTCC_LOCATION, which if not provided is in turn is set 
by the snippet:

# Variables inherited from the environment of the caller.
if [ -z "$DISTCC_LOCATION" ]; then
   # Set the default for location of 'pump' script'.
   DISTCC_LOCATION=`GetScriptDir "$0"`
fi

on my system this resolves to '/usr/bin' since distcc-pump is located at 
/usr/bin/distcc-pump

As far as I understand the bug manifests itself in the following way. The 
original compilers are located at /usr/bin/g++ etc and the The masquerade 
directory is located at /usr/lib/distcc/

The PATH variable is basically set to: 

'PATH=/usr/bin:/usr/lib/distcc:...'

Now we have a situation that conflicts with the documentation which says:

"Note that this masquerade directory must occur on the
PATH earlier than the directory that contains the actual compilers of
the same names."

Because /usr/bin is now at the start of the path, it picks up
/usr/bin/g++ instead of /usr/lib/distcc/g++

The simple fix is just to re-write two occurrences of the PATH setting line as:

PATH="$PATH:$distcc_location"

I have attached a patch. This works at least on my system (Ubuntu 14.04)

Regards,
Giles

Original comment by GilesBat...@gmail.com on 23 Apr 2014 at 9:20

Attachments: