set correct permissions for SCSI devices (#1028549)

This commit is contained in:
Nils Philippsen 2013-11-20 22:27:14 +01:00
parent b96345062f
commit b04b61c441
2 changed files with 56 additions and 1 deletions

View File

@ -0,0 +1,49 @@
From 1567fcb9d9dd3dea6e0978ef2473ac7dba7dbba0 Mon Sep 17 00:00:00 2001
From: Nils Philippsen <nils@redhat.com>
Date: Wed, 20 Nov 2013 22:04:21 +0100
Subject: [PATCH] patch: scsi-permissions
Squashed commit of the following:
commit 80e8a34505a45dd61761ce557bf029e33e39d2f2
Author: Nils Philippsen <nils@redhat.com>
Date: Wed Nov 20 21:45:23 2013 +0100
sane-desc: fix faulty udev logic for SCSI devices
SUBSYSTEMS!="..." seems to always match, i.e. skip the SCSI-specific
rules.
(cherry picked from commit 758731489d0d58bab6e4b70db9556038c9f4bb67)
---
tools/sane-desc.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/sane-desc.c b/tools/sane-desc.c
index ae218c3..72e11b8 100644
--- a/tools/sane-desc.c
+++ b/tools/sane-desc.c
@@ -3569,7 +3569,8 @@ print_udev (void)
printf ("\nLABEL=\"libsane_usb_rules_end\"\n\n");
- printf ("SUBSYSTEMS!=\"scsi\", GOTO=\"libsane_scsi_rules_end\"\n\n");
+ printf ("SUBSYSTEMS==\"scsi\", GOTO=\"libsane_scsi_rules_begin\"\n");
+ printf ("GOTO=\"libsane_scsi_rules_end\"\n\n");
printf ("LABEL=\"libsane_scsi_rules_begin\"\n");
printf ("# Generic: SCSI device type 6 indicates a scanner\n");
@@ -3695,7 +3696,9 @@ print_udevhwdb (void)
printf("ENV{DEVTYPE}==\"usb_device\", ENV{libsane_matched}==\"yes\", TEST==\"power/control\", ATTR{power/control}=\"on\"\n\n");
printf("ENV{DEVTYPE}==\"usb_device\", ENV{libsane_matched}==\"yes\", TEST!=\"power/control\", TEST==\"power/level\", ATTR{power/level}=\"on\"\n");
- printf ("SUBSYSTEMS!=\"scsi\", GOTO=\"libsane_rules_end\"\n");
+ printf ("SUBSYSTEMS==\"scsi\", GOTO=\"libsane_scsi_rules_begin\"\n");
+ printf ("GOTO=\"libsane_rules_end\"\n\n");
+ printf ("LABEL=\"libsane_scsi_rules_begin\"\n");
printf ("KERNEL!=\"sg[0-9]*\", GOTO=\"libsane_rules_end\"\n\n");
printf ("# Generic: SCSI device type 6 indicates a scanner\n");
--
1.8.4.2

View File

@ -37,7 +37,7 @@
Summary: Scanner access software Summary: Scanner access software
Name: sane-backends Name: sane-backends
Version: 1.0.24 Version: 1.0.24
Release: 6%{?dist} Release: 7%{?dist}
# lib/ is LGPLv2+, backends are GPLv2+ with exceptions # lib/ is LGPLv2+, backends are GPLv2+ with exceptions
# Tools are GPLv2+, docs are public domain # Tools are GPLv2+, docs are public domain
# see LICENSE for details # see LICENSE for details
@ -73,6 +73,8 @@ Patch5: sane-backends-1.0.24-pixma_bjnp-crash.patch
# Upstream commit dc76e7cce464f04e46aab2bb0c269b4742161c59 # Upstream commit dc76e7cce464f04e46aab2bb0c269b4742161c59
# Upstream commit d835d9d565118d52c2339c2e79890f57d0616077 # Upstream commit d835d9d565118d52c2339c2e79890f57d0616077
Patch6: sane-backends-1.0.24-static-code-check.patch Patch6: sane-backends-1.0.24-static-code-check.patch
# Upstream commit 758731489d0d58bab6e4b70db9556038c9f4bb67
Patch7: sane-backends-1.0.24-scsi-permissions.patch
URL: http://www.sane-project.org URL: http://www.sane-project.org
@ -188,6 +190,7 @@ This package contains backend drivers to access digital cameras through SANE.
%patch4 -p1 -b .hwdb %patch4 -p1 -b .hwdb
%patch5 -p1 -b .pixma_bjnp-crash %patch5 -p1 -b .pixma_bjnp-crash
%patch6 -p1 -b .static-code-check %patch6 -p1 -b .static-code-check
%patch7 -p1 -b .scsi-permissions
%build %build
CFLAGS="%optflags -fno-strict-aliasing" CFLAGS="%optflags -fno-strict-aliasing"
@ -309,6 +312,9 @@ udevadm hwdb --update >/dev/null 2>&1 || :
%{_libdir}/sane/*gphoto2.so* %{_libdir}/sane/*gphoto2.so*
%changelog %changelog
* Wed Nov 20 2013 Nils Philippsen <nils@redhat.com> - 1.0.24-7
- set correct permissions for SCSI devices (#1028549)
* Thu Nov 07 2013 Nils Philippsen <nils@redhat.com> - 1.0.24-6 * Thu Nov 07 2013 Nils Philippsen <nils@redhat.com> - 1.0.24-6
- epson: don't leak memory if realloc() fails - epson: don't leak memory if realloc() fails