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
This commit is contained in:
parent
2b0fc381f5
commit
7e89c8f2d8
33
hplip-check-userperms.patch
Normal file
33
hplip-check-userperms.patch
Normal file
@ -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: "
|
||||
10
hplip.spec
10
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 <zdohnal@redhat.com> - 3.20.9-4
|
||||
- 1899410 - non-sudoers cannot authenticate because of bad username in prompt
|
||||
|
||||
* Thu Nov 05 2020 Zdenek Dohnal <zdohnal@redhat.com> - 3.20.9-3
|
||||
- make is no longer in buildroot by default
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user