[ovirt-engine-cli] Use -passwdFile instead of -passdInput to fix #907931

Juan Hernandez jhernand at fedoraproject.org
Fri Feb 8 15:47:45 UTC 2013


commit bb9fe40a69e183ed7d3dbfd28e36d9ce53175df8
Author: Juan Hernandez <juan.hernandez at redhat.com>
Date:   Fri Feb 8 10:38:40 2013 +0100

    Use -passwdFile instead of -passdInput to fix #907931

 ...iewer-passwordFile-instead-of-passwdInput.patch |   56 ++++++++++++++++++++
 ovirt-engine-cli.spec                              |   10 +++-
 2 files changed, 65 insertions(+), 1 deletions(-)
---
diff --git a/0002-Use-vncviewer-passwordFile-instead-of-passwdInput.patch b/0002-Use-vncviewer-passwordFile-instead-of-passwdInput.patch
new file mode 100644
index 0000000..aad77db
--- /dev/null
+++ b/0002-Use-vncviewer-passwordFile-instead-of-passwdInput.patch
@@ -0,0 +1,56 @@
+From 7703e77786d2df3b94ab15cff5081a6fcc533e8f Mon Sep 17 00:00:00 2001
+From: Sander Hoentjen <sander at hoentjen.eu>
+Date: Fri, 8 Feb 2013 10:55:57 +0100
+Subject: [PATCH] Use vncviewer passwordFile instead of passwdInput
+
+Fedora 18 has dropped the patch to add passwdInput option to tigervnc
+
+Change-Id: I76178f15217c421d88879c88534d7cb3a7583426
+Signed-off-by: Sander Hoentjen <sander at hoentjen.eu>
+---
+ src/cli/messages.py                |  1 +
+ src/ovirtcli/platform/posix/vnc.py | 10 ++++++++--
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/src/cli/messages.py b/src/cli/messages.py
+index 6d6a573..21bacc5 100644
+--- a/src/cli/messages.py
++++ b/src/cli/messages.py
+@@ -30,6 +30,7 @@ class Messages():
+         NO_ID = '"--id" argument is not available for this type of %s.'
+         NO_NAME = '"--name" argument is not available for this type of show.'
+         NO_CONSOLE_FOUND = '%s viewer was not found, please install %s first.'
++        NO_SUCH_COMMAND = '%s command was not found, please install it first.'
+         NOT_CONNECTED = OvirtCliSettings.PRODUCT.lower() + '-shell is not connected.'
+         NO_SUCH_COLLECTION = 'no such collection "%s" or given arguments not valid.'
+         NO_CERTIFICATES = 'server CA certificate file must be specified for SSL secured connection.'
+diff --git a/src/ovirtcli/platform/posix/vnc.py b/src/ovirtcli/platform/posix/vnc.py
+index f6919ab..81de9dc 100644
+--- a/src/ovirtcli/platform/posix/vnc.py
++++ b/src/ovirtcli/platform/posix/vnc.py
+@@ -19,6 +19,7 @@ import os
+ from cli.error import Error
+ from ovirtcli.platform import util
+ from cli.messages import Messages
++from subprocess import Popen, PIPE
+ 
+ 
+ def launch_vnc_viewer(host, port, ticket, debug=False):
+@@ -29,7 +30,12 @@ def launch_vnc_viewer(host, port, ticket, debug=False):
+     cmd = util.which('vncviewer')
+     if cmd is None:
+         raise Error, Messages.Error.NO_CONSOLE_FOUND % ('vnc', 'vnc')
+-    args = ['vncviewer', '%s::%s' % (host, port), '-passwdInput' ]
++    cmd_passwd = util.which('vncpasswd')
++    if cmd_passwd is None:
++        raise Error, Messages.Error.NO_SUCH_COMMAND % 'vncpasswd'
++    p = Popen([cmd_passwd, "-f"], shell=False, stdin=PIPE, stdout=PIPE)
++    password = p.communicate(input=ticket)[0]
++    args = [cmd, '%s::%s' % (host, port), '-passwordFile', '/dev/stdin' ]
+     pid, pstdin = util.spawn(cmd, args, debug)
+-    os.write(pstdin, ticket)
++    os.write(pstdin, password)
+     os.close(pstdin)
+-- 
+1.8.1
+
diff --git a/ovirt-engine-cli.spec b/ovirt-engine-cli.spec
index 0fa12b3..2dd4714 100644
--- a/ovirt-engine-cli.spec
+++ b/ovirt-engine-cli.spec
@@ -1,6 +1,6 @@
 Name: ovirt-engine-cli
 Version: 3.2.0.9
-Release: 2%{dist}
+Release: 3%{dist}
 Summary: oVirt Engine Command Line Interface
 Group: Development/Libraries
 License: ASL 2.0
@@ -30,12 +30,17 @@ Conflicts: python-cli
 # Need to use the pexpect-u instead of pexpect in the build script:
 Patch1: 0001-Use-pexpect-u-instead-of-pexpect.patch
 
+# The -passwdInput option of the vncviewer command is not available in
+# Fedora 18, so we need to use the -passwdFile option instead:
+Patch2: 0002-Use-vncviewer-passwordFile-instead-of-passwdInput.patch
+
 %description
 The command line interface for oVirt-Engine.
 
 %prep
 %setup -q
 %patch1 -p1
+%patch2 -p1
 
 %build
 
@@ -62,6 +67,9 @@ popd
 %doc LICENSE
 
 %changelog
+* Fri Feb 08 2013 Juan Hernandez <juan.hernandez at redhat.com> - 3.2.0.9-3
+- Use -passwdFile instead of -passwdInput to fix #907931
+
 * Thu Jan 31 2013 Juan Hernandez <juan.hernandez at redhat.com> - 3.2.0.9-2
 - Use pexpect-u instead of pexpect to really fix #905359
 


More information about the scm-commits mailing list