~nova-coresec/ubuntu/maverick/libvirt/nova-ppa

« back to all changes in this revision

Viewing changes to src/remote/remote_driver.c

  • Committer: Bazaar Package Importer
  • Author(s): Marc Deslauriers
  • Date: 2010-08-25 12:41:25 UTC
  • Revision ID: james.westby@ubuntu.com-20100825124125-nb0hjue2cku30yw8
Tags: 0.8.3-1ubuntu8
debian/patches/9009-autodetect-nc-params.patch: updated to fix
connecting to a remote server when using zsh or tcsh. (LP: #605172)

Show diffs side-by-side

added added

removed removed

Lines of Context:
730
730
    }
731
731
 
732
732
    case trans_ssh: {
733
 
        int j, nr_args = 4;
 
733
        int j, nr_args = 5;
734
734
        virBuffer cmd_netcat = VIR_BUFFER_INITIALIZER;
735
735
 
736
736
        if (username) nr_args += 2; /* For -l username */
764
764
            cmd_argv[j++] = strdup ("none");
765
765
        }
766
766
        cmd_argv[j++] = strdup (priv->hostname);
 
767
        cmd_argv[j++] = strdup ("sh -c");
767
768
 
768
769
        /*
769
770
         * This ugly thing is a shell script to detect availability of
776
777
         * to the desired behavior.
777
778
         */
778
779
 
779
 
        virBufferVSprintf(&cmd_netcat, "%s -q 2>&1 | grep -q 'requires an argument';"
 
780
        virBufferVSprintf(&cmd_netcat, "'%s -q 2>&1 | grep -q \"requires an argument\";"
780
781
                                       "if [ $? -eq 0 ] ; then"
781
 
                                       "   CMD='-q 0';"
 
782
                                       "   CMD=\"%s -q 0 -U %s\";"
782
783
                                       "else"
783
 
                                       "   CMD='';"
784
 
                                       "fi;%s $CMD -U %s",
785
 
                                       netcat ? netcat : "nc",
 
784
                                       "   CMD=\"%s -U %s\";"
 
785
                                       "fi;"
 
786
                                       "eval \"$CMD\";'",
 
787
                                       netcat ? netcat : "nc",
 
788
                                       netcat ? netcat : "nc",
 
789
                                       sockname ? sockname :
 
790
                                        (flags & VIR_CONNECT_RO
 
791
                                         ? LIBVIRTD_PRIV_UNIX_SOCKET_RO
 
792
                                         : LIBVIRTD_PRIV_UNIX_SOCKET),
786
793
                                       netcat ? netcat : "nc",
787
794
                                       sockname ? sockname :
788
795
                                        (flags & VIR_CONNECT_RO