~ubuntu-branches/ubuntu/karmic/libvirt/karmic-proposed

« back to all changes in this revision

Viewing changes to debian/patches/0004-Don-t-hardcode-ssh-port.patch

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2009-02-11 01:01:42 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090211010142-8zrm7z1u6ryfhkiq
Tags: 0.6.0-1ubuntu1
* Merge with Debian experimental. Remaining changes:
  - debian/control:
    + Don't build-depend on QEmu.
    + Add "XS-Debian-" prefix to Debian's Vcs headers.
    + Bump bridge-utils, dnsmasq-base, netcat-openbsd, and iptables
      to Depends of libvirt-bin.
    + s/interract/interact/g
    + Add versioned Conflicts/Replaces to libvirt0 for libvirt0-dbg,
      since we used to ship them as such.
  - Rename libvirt group to libvirtd.
  - 0005-delayed_iff_up_bridge.patch: Don't try to bring up the bridge
    before at least one interface has been added to it.
  - dont_clobber_existing_bridges.patch: Assign the name of the virtual
    bridge dynamically to avoid interfering with existing bridges.
  - better_default_uri_virsh.patch: Default to qemu:///system if the
    user has write access to the libvirt socket, otherwise
    qemu:///session.
  - We call libxen-dev libxen3-dev, so change all references.
  - Included (but did not enable) opennebula patch (since it's not in
    main yet).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From: =?utf-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
 
2
Date: Fri, 30 Jan 2009 22:01:15 +0100
 
3
Subject: [PATCH] Don't hardcode ssh port
 
4
 
 
5
based on a patch by Adrian Bridgett.
 
6
 
 
7
Closes: #513605
 
8
---
 
9
 src/remote_internal.c |   14 +++++++-------
 
10
 1 files changed, 7 insertions(+), 7 deletions(-)
 
11
 
 
12
diff --git a/src/remote_internal.c b/src/remote_internal.c
 
13
index f8740af..dbd9673 100644
 
14
--- a/src/remote_internal.c
 
15
+++ b/src/remote_internal.c
 
16
@@ -387,9 +387,6 @@ doRemoteOpen (virConnectPtr conn,
 
17
     } else if (transport == trans_tcp) {
 
18
         port = strdup (LIBVIRTD_TCP_PORT);
 
19
         if (!port) goto out_of_memory;
 
20
-    } else if (transport == trans_ssh) {
 
21
-        port = strdup ("22");
 
22
-        if (!port) goto out_of_memory;
 
23
     } else
 
24
         port = NULL;           /* Port not used for unix, ext. */
 
25
 
 
26
@@ -673,24 +670,27 @@ doRemoteOpen (virConnectPtr conn,
 
27
     }
 
28
 
 
29
     case trans_ssh: {
 
30
-        int j, nr_args = 8;
 
31
+        int j, nr_args = 6;
 
32
 
 
33
         if (username) nr_args += 2; /* For -l username */
 
34
         if (no_tty) nr_args += 5;   /* For -T -o BatchMode=yes -e none */
 
35
+        if (port) nr_args += 2;     /* For -p port */
 
36
 
 
37
         command = command ? command : strdup ("ssh");
 
38
         if (command == NULL)
 
39
             goto out_of_memory;
 
40
 
 
41
         // Generate the final command argv[] array.
 
42
-        //   ssh -p $port [-l $username] $hostname $netcat -U $sockname [NULL]
 
43
+        //   ssh [-p $port] [-l $username] $hostname $netcat -U $sockname [NULL]
 
44
         if (VIR_ALLOC_N(cmd_argv, nr_args) < 0)
 
45
             goto out_of_memory;
 
46
 
 
47
         j = 0;
 
48
         cmd_argv[j++] = strdup (command);
 
49
-        cmd_argv[j++] = strdup ("-p");
 
50
-        cmd_argv[j++] = strdup (port);
 
51
+        if (port) {
 
52
+            cmd_argv[j++] = strdup ("-p");
 
53
+            cmd_argv[j++] = strdup (port);
 
54
+        }
 
55
         if (username) {
 
56
             cmd_argv[j++] = strdup ("-l");
 
57
             cmd_argv[j++] = strdup (username);
 
58
--