From 7e89c8f2d84a11ef806cf90850f1edff31dae339 Mon Sep 17 00:00:00 2001 From: DistroBaker Date: Sun, 22 Nov 2020 17:31:54 +0000 Subject: [PATCH] Merged update from upstream sources This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/hplip.git#2015e140a3fde37fed190f5e80df683de35b5d8f --- hplip-check-userperms.patch | 33 +++++++++++++++++++++++++++++++++ hplip.spec | 10 +++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 hplip-check-userperms.patch diff --git a/hplip-check-userperms.patch b/hplip-check-userperms.patch new file mode 100644 index 0000000..9204c0b --- /dev/null +++ b/hplip-check-userperms.patch @@ -0,0 +1,33 @@ +diff --git a/base/password.py b/base/password.py +index bd68f2a..bff9f80 100644 +--- a/base/password.py ++++ b/base/password.py +@@ -157,6 +157,28 @@ class Password(object): + log.warn("%s distro is not found in AUTH_TYPES" % distro_name) + self.__authType = 'su' + ++ # check if caller is in wheel group - use 'su' if he isnt - ++ # or if the caller is root (just for showing 'root' username) ++ # in the prompt ++ import os ++ from grp import getgrnam ++ ++ user = os.getenv('USER') ++ ++ try: ++ members = getgrnam('wheel').gr_mem ++ except KeyError: ++ try: ++ members = getgrnam('sudo').gr_mem ++ except: ++ return ++ ++ if user in members: ++ self.__authType = 'sudo' ++ else: ++ self.__authType = 'su' ++ ++ + def __getPasswordDisplayString(self): + if self.__authType == "su": + return "Please enter the root/superuser password: " diff --git a/hplip.spec b/hplip.spec index d4bc628..7acf707 100644 --- a/hplip.spec +++ b/hplip.spec @@ -7,7 +7,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.20.9 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ and MIT and BSD and IJG and Public Domain and GPLv2+ with exceptions and ISC Url: https://developers.hp.com/hp-linux-imaging-and-printing @@ -165,6 +165,9 @@ Patch57: hplip-thread-isalive-removed.patch # the code doesn't use anything from timeb.h, so it is safe to remove it # reported upstream https://bugs.launchpad.net/hplip/+bug/1900977 Patch58: hplip-timeb-removed.patch +# non-sudoers cannot authenticate +# reported upstream https://bugs.launchpad.net/hplip/+bug/1904888 +Patch59: hplip-check-userperms.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} @@ -444,6 +447,8 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h %patch57 -p1 -b .thread-isalive-removed # timed.h is removed from glibc %patch58 -p1 -b .timed-removed +# 1899410 - non-sudoers cannot authenticate because of bad username in prompt +%patch59 -p1 -b .check-userperms sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ @@ -778,6 +783,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio %changelog +* Thu Nov 19 2020 Zdenek Dohnal - 3.20.9-4 +- 1899410 - non-sudoers cannot authenticate because of bad username in prompt + * Thu Nov 05 2020 Zdenek Dohnal - 3.20.9-3 - make is no longer in buildroot by default