[distcc] path gets trimmed to nothing (was distcc over SSH)

Martin Pool mbp at samba.org
Mon Oct 13 10:05:19 GMT 2003


On  2 Oct 2003, Ari Pollak <ari at ccs.neu.edu> wrote:
> Hi, I'm having problems using distcc over SSH. distcc as a
> daemon works fine, but this is less than optimal because of
> security issues. However, running distcc over SSH seems to give
> all sorts of PATH problems. distcc lives in /arch/beta/bin (the
> convention for this enviornment). When calling make as 'make
> CC="/arch/beta/bin/distcc /usr/bin/gcc"
> CXX="/arch/beta/bin/distcc /usr/bin/g++"', it fails because it
> either can't find ssh or as. Attached is the debugged output from
> make/distcc.

Thanks for your bug report, and for including the right information.

> make[1]: Entering directory `/net/arch-linux/unix/src/wine-20030911/libs'
> make[2]: Entering directory `/net/arch-linux/unix/src/wine-20030911/libs/port'
> /arch/beta/bin/distcc /usr/bin/gcc -c -I. -I. -I../../include -I../../include  -D_REENTRANT -fPIC -D__WINESRC__ -Wall -mpreferred-stack-boundary=2 -fno-strict-aliasing -gstabs+ -Wpointer-arith  -g -O2 -o getopt.o getopt.c
> distcc[15816] (dcc_trace_version) distcc 2.11 i686-pc-linux-gnu; built Oct  2 2003 09:30:44
> distcc[15816] (dcc_recursion_safeguard) safeguard level=0
> distcc[15816] (dcc_trim_path) original PATH /proj/crew/ari/BitTorrent-3.2.1b:~/bin:/proj/crew/ari/mplayer/bin:~/bin/linux:/proj/crew/ari/bin/linux:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/ccs/bin:/arch/beta/bin:/arch/beta/bin
> distcc[15816] (dcc_set_path) setting PATH=

I think this is the problem.

Would I be right in guessing you have a link like 

  distcc -> distcc-2.11

in /arch/beta/bin?

Does this patch fix it?  You may need to make the change by hand.

Wayne, does this look reasonable to you?  I think trimming the path
there is redundant.



--- distcc.c.~1.216.~	2003-10-13 19:39:39.000000000 +1000
+++ distcc.c	2003-10-13 19:59:25.000000000 +1000
@@ -171,6 +171,8 @@ int main(int argc, char **argv)
 
     sg_level = dcc_recursion_safeguard();
 
+    rs_trace("compiler name is \"%s\"", compiler_name);
+
     if (strstr(compiler_name, "distcc") != NULL) {
         /* Either "distcc -c hello.c" or "distcc gcc -c hello.c" */
         if (argc <= 1 || !strcmp(argv[1], "--help")) {
@@ -188,8 +190,13 @@ int main(int argc, char **argv)
         /* compiler_args is now respectively either "cc -c hello.c" or
          * "gcc -c hello.c" */
 
+#if 0
+        /* I don't think we need to call this: if we reached this
+         * line, our invocation name is something like 'distcc', and
+         * that's never a problem for masquerading loops. */
         if ((ret = dcc_trim_path(compiler_name)) != 0)
             goto out;
+#endif
     } else {
         /* Invoked as "cc -c hello.c", with masqueraded path */
         if ((ret = dcc_support_masquerade(argv, compiler_name,


-- 
Martin 



More information about the distcc mailing list