Bug 396761

Summary: netcat -U not supported under Debian, breaks libvirt's ssh connections
Product: [Fedora] Fedora Reporter: Richard W.M. Jones <rjones>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: berrange
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-03-12 11:54:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Richard W.M. Jones 2007-11-23 14:12:35 UTC
Description of problem:

'netcat -U' option is not supported by the Debian version of netcat.  It
appears that they use a 'netcat' which is based on a completely different
codebase from the one in Fedora.

Version-Release number of selected component (if applicable):

libvirt from CVS
Debian netcat 1.10

This is the problematic code in src/remote_internal.c:

        // Generate the final command argv[] array.
        //   ssh -p $port [-l $username] $hostname $netcat -U $sockname [NULL]
        cmd_argv = malloc (nr_args * sizeof (char *));
        if (cmd_argv == NULL) {
            error (NULL, VIR_ERR_SYSTEM_ERROR, strerror (errno));
            goto failed;
        }

        j = 0;
        cmd_argv[j++] = strdup (command);
        cmd_argv[j++] = strdup ("-p");
        cmd_argv[j++] = strdup (port);
        if (username) {
            cmd_argv[j++] = strdup ("-l");
            cmd_argv[j++] = strdup (username);
        }
        if (no_tty) {
            cmd_argv[j++] = strdup ("-T");
            cmd_argv[j++] = strdup ("-o");
            cmd_argv[j++] = strdup ("BatchMode=yes");
            cmd_argv[j++] = strdup ("-e");
            cmd_argv[j++] = strdup ("none");
        }
        cmd_argv[j++] = strdup (server);
        cmd_argv[j++] = strdup (netcat ? netcat : "nc");
        cmd_argv[j++] = strdup ("-U");
        cmd_argv[j++] = strdup (sockname ? sockname : LIBVIRTD_PRIV_UNIX_SOCKET)
;
        cmd_argv[j++] = 0;

Comment 1 Richard W.M. Jones 2007-11-24 07:50:03 UTC
This is the Debian tracking bug for this:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=348564

Comment 2 Soren Hansen 2008-03-12 09:45:30 UTC
We've since added the netcat-openbsd package to Debian and Ubuntu. Installing
that package (on the remote machine, that is) will fix this issue.

Comment 3 Daniel Berrangé 2008-03-12 11:54:58 UTC
Ok, closing this WONTFIX on the grounds that there's a supportable way to make
it work now.