Merge branch 'f23'

This commit is contained in:
Jiri Popelka 2016-01-27 19:08:30 +01:00
commit ef71424634
2 changed files with 34 additions and 11 deletions

View File

@ -1,15 +1,15 @@
From f46ac074d066884480098c14397f5f3e34475e11 Mon Sep 17 00:00:00 2001
From 469029615ffd32cf78f3be575694ed58236da3e0 Mon Sep 17 00:00:00 2001
From: Jiri Popelka <jpopelka@redhat.com>
Date: Fri, 22 Jan 2016 16:30:13 +0100
Subject: [PATCH] fix from launchpad #1510950
---
base/password.py | 17 ++++++++++++++++-
base/password.py | 27 +++++++++++++++++++++++----
base/utils.py | 53 ++++++++++++++++++++++++++++++++++-------------------
2 files changed, 50 insertions(+), 20 deletions(-)
2 files changed, 57 insertions(+), 23 deletions(-)
diff --git a/base/password.py b/base/password.py
index 3ca16ae..6caefdf 100644
index 3ca16ae..f69a248 100644
--- a/base/password.py
+++ b/base/password.py
@@ -104,6 +104,7 @@ def get_distro_name():
@ -20,14 +20,27 @@ index 3ca16ae..6caefdf 100644
self.__passwordValidated = False
self.__mode = Mode
self.__readAuthType() #self.__authType
@@ -201,7 +202,17 @@ class Password(object):
@@ -200,8 +201,7 @@ class Password(object):
i = child.expect(self.__expectList)
cb = child.before
if cb:
- if cb:
-
+ if cb:
start = time.time()
output.write(cb)
@@ -209,11 +209,26 @@ class Password(object):
ok, ret = True, output.getvalue()
break
- elif i == 1: # TIMEOUT
-
+ elif i == 1: # TIMEOUT
+ if('true' in cmd and self.__password_prompt_str == ""): #sudo true or su -c "true"
+ cb = cb.replace("[", "\[")
+ cb = cb.replace("]", "\]")
+
+ self.__password_prompt_str = cb
+ try:
+ p = re.compile(cb, re.I)
@ -35,11 +48,18 @@ index 3ca16ae..6caefdf 100644
+ self.__expectList.append(cb)
+ else:
+ self.__expectList.append(p)
+
start = time.time()
output.write(cb)
+ log.debug("Adding missing password prompt string [%s]"%self.__password_prompt_str)
continue
@@ -355,3 +366,7 @@ class Password(object):
else: # password
+ if(self.__password_prompt_str == ""):
+ self.__password_prompt_str = utils.EXPECT_WORD_LIST[i]
+ log.debug("Updating password prompt string [%s]"%self.__password_prompt_str)
+
child.sendline(self.__password)
except (Exception, pexpect.ExceptionPexpect) as e:
@@ -355,3 +370,7 @@ class Password(object):
self.__validatePassword( pswd_msg)
return self.__password

View File

@ -7,7 +7,7 @@
Summary: HP Linux Imaging and Printing Project
Name: hplip
Version: 3.15.11
Release: 5%{?dist}
Release: 6%{?dist}
License: GPLv2+ and MIT and BSD
Url: http://hplip.sourceforge.net/
@ -461,6 +461,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
%postun libs -p /sbin/ldconfig
%changelog
* Wed Jan 27 2016 Jiri Popelka <jpopelka@redhat.com> - 3.15.11-6
- updated patch for bug #1249414
* Fri Jan 22 2016 Jiri Popelka <jpopelka@redhat.com> - 3.15.11-5
- hp-plugin hangs on 'su' (bug #1249414).