[distcc] distcc over ssh - what am i doing wrong here?

Martin Pool mbp at samba.org
Thu Feb 19 02:55:52 GMT 2004


On 15 Feb 2004, Jeff Rizzo <riz+distcc at boogers.sf.ca.us> wrote:
> On Mon, Feb 16, 2004 at 10:54:06AM +1100, Martin Pool wrote:
> > On 15 Feb 2004, Jeff Rizzo <riz+distcc at boogers.sf.ca.us> wrote:
> > 
> > > distcc[25205] (dcc_run_piped_cmd) execute: ssh -l riz madmax distccd --inetd
> > > distcc[25205] (dcc_collect_child) ssh child 2378 terminated with status 0x6400
> > > distcc[25205] (dcc_collect_child) ssh times: user 0.110708s, system 0.033086s, 686 minflt, 0 majflt
> > 
> > The SSH connection failed with exit code 0x64 == 100, which is
> > EXIT_DISTCC_FAILED.  So my guess would be that ssh did invoke distccd,
> > but then something went wrong.
> > 
> > Can you look in the daemon and auth logs on madmax and see if there is
> > any indication of what went wrong?
> > 
> 
> This is the only thing I can find:
> 
> Feb 15 16:35:22 madmax distccd[12795]: (dcc_inetd_server) Warning: failed to get peer name: Socket operation on non-socket
> Feb 15 16:35:22 madmax distccd[12795]: (dcc_sockaddr_to_string) ERROR: getnameinfo failed: ai_family not supported

Thanks for that.  

Could you try this patch and report the results, please?

Index: head/src/netutil.c
===================================================================
--- head.orig/src/netutil.c	2003-11-28 10:55:12.000000000 +1100
+++ head/src/netutil.c	2004-02-19 12:37:10.000000000 +1100
@@ -140,18 +140,26 @@
     char host[1024];
     char port[32];
 
-    err = getnameinfo(sa, salen,
-                      host, sizeof host,
-                      port, sizeof port,
-                      NI_NUMERICHOST | NI_NUMERICSERV);
-    if (err) {
-        rs_log_error("getnameinfo failed: %s", gai_strerror(err));
-        *p_buf = strdup("(UNKNOWN)");
-        return EXIT_DISTCC_FAILED; /* more specific? */
+    if (sa->sa_family == AF_INET || sa->sa_family == AF_INET6) {
+        err = getnameinfo(sa, salen,
+                          host, sizeof host,
+                          port, sizeof port,
+                          NI_NUMERICHOST | NI_NUMERICSERV);
+        if (err) {
+            rs_log_warning("getnameinfo failed: %s", gai_strerror(err));
+            *p_buf = strdup("(UNKNOWN)");
+            return 0;               /* it's still a valid string */
+        }
+        
+        asprintf(p_buf, "%s:%s", host, port);
+    } else if (sa->sa_family == AF_UNIX) {
+        /* NB: The word 'sun' is predefined on Solaris */
+        struct sockaddr_un *sa_un = (struct sockaddr_un *) sa;
+        asprintf(p_buf, "UNIX-DOMAIN %s", sa_un->sun_path);
+    } else {
+        asprintf(p_buf, "UNKNOWN-FAMILY %d", sa->sa_family);
     }
 
-    asprintf(p_buf, "%s:%s", host, port);
-
     return 0;
 }
 #else /* ndef ENABLE_RFC2553 */
Index: head/ChangeLog
===================================================================
--- head.orig/ChangeLog	2004-02-19 12:37:56.000000000 +1100
+++ head/ChangeLog	2004-02-19 13:52:23.000000000 +1100
@@ -1,3 +1,11 @@
+2004-02-19  Martin Pool  <mbp at sourcefrog.net>
+
+	* src/netutil.c (dcc_sockaddr_to_string): [ENABLE_RFC2553]:
+	Failure to convert the address to a string should be just a
+	warning, not an error.  Add special cases for unix-domain sockets
+	and unknown address families.  Possibly fixes SSH connections with
+	ENABLE_RFC2553.
+	
 2004-01-11  Martin Pool  <mbp at sourcefrog.net>
 
 	* src/srvnet.c (dcc_check_client): Take list of allowed addresses


-- 
Martin 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/distcc/attachments/20040219/da6e2964/attachment.bin


More information about the distcc mailing list