udev: set up for generic user access rules

This commit is contained in:
Nils Philippsen 2012-09-10 12:34:06 +02:00
parent 0efbfd602f
commit ad47c78c61
2 changed files with 46 additions and 16 deletions

View File

@ -1,21 +1,27 @@
commit 2fd4ea713546ef0cb9f67ee7853e9b1d01f64071
Author: Nils Philippsen <nils@redhat.com>
AuthorDate: Fri Aug 31 15:54:01 2012 +0200
Commit: Nils Philippsen <nils@redhat.com>
CommitDate: Fri Aug 31 15:54:01 2012 +0200
From c7f5126447ed5335a54d9333ac37f35c2189fbf4 Mon Sep 17 00:00:00 2001
From: Nils Philippsen <nils@redhat.com>
Date: Mon, 10 Sep 2012 12:25:33 +0200
Subject: [PATCH] patch: udev
patch: udev
Squashed commit of the following:
commit 99a4a33bd297f5b475ac610cf2d51385893596b9
Author: Nils Philippsen <nils@redhat.com>
Date: Fri Aug 31 15:51:55 2012 +0200
adapt generated udev rules for Fedora
Squashed commit of the following:
commit 3d19b3eaf91fa8c3c2a78956f570d3e0f4c3f342
Author: Nils Philippsen <nils@redhat.com>
Date: Mon Sep 10 12:25:16 2012 +0200
adapt generated udev rules for Fedora
commit 7017c3ad1dadc27edd2c47ceec04f8648c839d53
Author: Nils Philippsen <nils@redhat.com>
Date: Mon Sep 10 12:20:43 2012 +0200
use group and mode macros consistently
---
tools/sane-desc.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/tools/sane-desc.c b/tools/sane-desc.c
index 7bbd012..9447cb8 100644
index 7bbd012..5c5bbe9 100644
--- a/tools/sane-desc.c
+++ b/tools/sane-desc.c
@@ -56,9 +56,9 @@
@ -40,3 +46,19 @@ index 7bbd012..9447cb8 100644
printf ("\nLABEL=\"libsane_usb_rules_end\"\n\n");
@@ -3619,10 +3620,8 @@ print_udev (void)
}
printf ("LABEL=\"libsane_scsi_rules_end\"\n");
- if (mode == output_mode_udevacl)
- printf("\nENV{libsane_matched}==\"yes\", RUN+=\"/bin/setfacl -m g:%s:rw $env{DEVNAME}\"\n", DEVGROUP);
- else
- printf ("\nENV{libsane_matched}==\"yes\", MODE=\"664\", GROUP=\"scanner\"\n");
+ if (mode != output_mode_udevacl)
+ printf ("\nENV{libsane_matched}==\"yes\", MODE=\"%s\", GROUP=\"%s\"\n", DEVMODE, DEVGROUP);
printf ("\nLABEL=\"libsane_rules_end\"\n");
}
--
1.7.11.4

View File

@ -12,7 +12,7 @@
Summary: Scanner access software
Name: sane-backends
Version: 1.0.23
Release: 2%{?dist}
Release: 3%{?dist}
# lib/ is LGPLv2+, backends are GPLv2+ with exceptions
# Tools are GPLv2+, docs are public domain
# see LICENSE for details
@ -132,6 +132,11 @@ LDFLAGS="-pie"
--enable-pthread
make %{?_smp_mflags}
# Ensure ACL style udev rules
_topdir="$PWD"
pushd tools
./sane-desc -m udev+acl -s "${_topdir}/doc/descriptions:${_topdir}/doc/descriptions-external" -d0 > udev/libsane.rules
popd
%install
make DESTDIR="%{buildroot}" install
@ -194,6 +199,9 @@ install -m 0644 tools/sane-backends.pc %{buildroot}%{_libdir}/pkgconfig/
%{_libdir}/sane/*gphoto2.so.*
%changelog
* Mon Sep 10 2012 Nils Philippsen <nils@redhat.com> - 1.0.23-3
- udev: set up for generic user access rules
* Tue Sep 04 2012 Nils Philippsen <nils@redhat.com> - 1.0.23-2
- make installed sane-config multi-lib aware again