From d360f3c6905dfc314d3ece560931dea9c7360161 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Fri, 30 Jul 2021 07:18:24 +0200 Subject: [PATCH] 1985251 - Incorrect permission for gpg directory 1987141 - hp-plugin installs malformed udev files --- hplip-plugin-udevissues.patch | 26 ++++++++++++++++++++++++++ hplip.spec | 6 ++++++ 2 files changed, 32 insertions(+) create mode 100644 hplip-plugin-udevissues.patch diff --git a/hplip-plugin-udevissues.patch b/hplip-plugin-udevissues.patch new file mode 100644 index 0000000..3a35c6b --- /dev/null +++ b/hplip-plugin-udevissues.patch @@ -0,0 +1,26 @@ +diff --git a/installer/pluginhandler.py b/installer/pluginhandler.py +index 1af8d85..5c498ab 100755 +--- a/installer/pluginhandler.py ++++ b/installer/pluginhandler.py +@@ -403,7 +403,20 @@ class PluginHandle(object): + log.error("Target file %s does not exist. File copy failed." % trg) + continue + else: +- os.chmod(trg, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH) ++ if trg == '/etc/udev/rules.d/S99-2000S1.rules' or \ ++ trg == '/etc/udev/rules.d/40-libsane.rules': ++ os.chmod(trg, 0o644) ++ with open(trg, 'r') as udev_f: ++ content = udev_f.read() ++ ++ content = content.replace('libsane_rules_end', 'libsane_usb_rules_end') ++ content = content.replace('GROUP="scanner", ', '') ++ ++ with open(trg, 'w') as udev_f: ++ udev_f.write(content) ++ ++ else: ++ os.chmod(trg, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH) + + if link: + if os.path.exists(link): diff --git a/hplip.spec b/hplip.spec index 21accd9..933b2df 100644 --- a/hplip.spec +++ b/hplip.spec @@ -199,6 +199,9 @@ Patch64: hplip-pyssizet_clean.patch # 1985251 - Incorrect permission for gpg directory # reported upstream https://bugs.launchpad.net/hplip/+bug/1938442 Patch65: hplip-gpgdir-perms.patch +# 1987141 - hp-plugin installs malformed udev files +# reported upstream https://bugs.launchpad.net/hplip/+bug/1847477 +Patch66: hplip-plugin-udevissues.patch %if 0%{?fedora} || 0%{?rhel} <= 8 # mention hplip-gui if you want to have GUI @@ -500,6 +503,8 @@ done %patch64 -p1 -b .pyssizet_clean # 1985251 - Incorrect permission for gpg directory %patch65 -p1 -b .gpgdir-perms +# 1987141 - hp-plugin installs malformed udev files +%patch66 -p1 -b .hpplugin-udevperms %if 0%{?fedora} || 0%{?rhel} <= 8 # mention hplip-gui should be installed if you want GUI @@ -850,6 +855,7 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %changelog * Fri Jul 30 2021 Zdenek Dohnal - 3.21.2-10 - 1985251 - Incorrect permission for gpg directory +- 1987141 - hp-plugin installs malformed udev files * Thu Jul 22 2021 Fedora Release Engineering - 3.21.2-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild