chiark / gitweb /
use the usual TAG+=, TAG= logic
authorKay Sievers <kay.sievers@vrfy.org>
Thu, 22 Apr 2010 17:03:11 +0000 (19:03 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Thu, 22 Apr 2010 17:03:11 +0000 (19:03 +0200)
extras/udev-acl/70-acl.rules
udev/udev-rules.c

index cf6b0ea..8300ec2 100644 (file)
@@ -1,6 +1,6 @@
 # do not edit this file, it will be overwritten on update
 
-# Do not use ACL_MANAGE outside of this file. This variable is private to
+# Do not use TAG+="udev-acl" outside of this file. This variable is private to
 # udev-acl of this udev release and may be replaced at any time.
 
 ENV{MAJOR}=="", GOTO="acl_end"
@@ -8,67 +8,67 @@ ACTION=="remove", GOTO="acl_apply"
 
 # PTP/MTP protocol devices, cameras, portable media players
 SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="", ENV{DEVTYPE}=="usb_device", IMPORT{program}="usb_id --export %p"
-SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", TAG="udev-acl"
+SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", TAG+="udev-acl"
 
 # digicams with proprietary protocol
-ENV{ID_GPHOTO2}=="*?", TAG="udev-acl"
+ENV{ID_GPHOTO2}=="*?", TAG+="udev-acl"
 
 # SCSI scanners
-KERNEL=="sg[0-9]*", ATTRS{type}=="6", TAG="udev-acl"
-KERNEL=="sg[0-9]*", ATTRS{type}=="3", ATTRS{vendor}=="HP|EPSON|Epson", TAG="udev-acl"
+KERNEL=="sg[0-9]*", ATTRS{type}=="6", TAG+="udev-acl"
+KERNEL=="sg[0-9]*", ATTRS{type}=="3", ATTRS{vendor}=="HP|EPSON|Epson", TAG+="udev-acl"
 
 # USB scanners
-ENV{libsane_matched}=="yes", TAG="udev-acl"
+ENV{libsane_matched}=="yes", TAG+="udev-acl"
 
 # HPLIP devices (necessary for ink level check and HP tool maintenance)
-ENV{ID_HPLIP}=="1", TAG="udev-acl"
+ENV{ID_HPLIP}=="1", TAG+="udev-acl"
 
 # optical drives
-SUBSYSTEM=="block", ENV{ID_CDROM}=="1", TAG="udev-acl"
+SUBSYSTEM=="block", ENV{ID_CDROM}=="1", TAG+="udev-acl"
 
 # sound devices
-SUBSYSTEM=="sound", TAG="udev-acl"
+SUBSYSTEM=="sound", TAG+="udev-acl"
 # sound jack-sense
-SUBSYSTEM=="input", SUBSYSTEMS=="sound", TAG="udev-acl"
+SUBSYSTEM=="input", SUBSYSTEMS=="sound", TAG+="udev-acl"
 
 # webcams, frame grabber, TV cards
-SUBSYSTEM=="video4linux", TAG="udev-acl"
-SUBSYSTEM=="dvb", TAG="udev-acl"
+SUBSYSTEM=="video4linux", TAG+="udev-acl"
+SUBSYSTEM=="dvb", TAG+="udev-acl"
 
 # IIDC devices: industrial cameras and some webcams
-SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*",  TAG="udev-acl"
+SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*",  TAG+="udev-acl"
 # AV/C devices: camcorders, set-top boxes, TV sets, audio devices, and more
-SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", TAG="udev-acl"
+SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", TAG+="udev-acl"
 
 # old style firewire devices
-KERNEL=="dv1394-[0-9]*", TAG="udev-acl"
-KERNEL=="video1394-[0-9]*", TAG="udev-acl"
+KERNEL=="dv1394-[0-9]*", TAG+="udev-acl"
+KERNEL=="video1394-[0-9]*", TAG+="udev-acl"
 
 # fingerprint readers
-SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="2016", TAG="udev-acl"
+SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="2016", TAG+="udev-acl"
 
 # GPS devices
  # Garmin GPSMap 60
-SUBSYSTEM=="usb", ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", TAG="udev-acl"
+SUBSYSTEM=="usb", ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", TAG+="udev-acl"
 
 
 # DRI video devices
-SUBSYSTEM=="drm", KERNEL=="card*", TAG="udev-acl"
+SUBSYSTEM=="drm", KERNEL=="card*", TAG+="udev-acl"
 
 # KVM
-SUBSYSTEM=="misc", KERNEL=="kvm", TAG="udev-acl"
+SUBSYSTEM=="misc", KERNEL=="kvm", TAG+="udev-acl"
 
 # smart-card readers
-ENV{ID_SMARTCARD_READER}=="*?", TAG="udev-acl"
+ENV{ID_SMARTCARD_READER}=="*?", TAG+="udev-acl"
 
 # joysticks
-SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG="udev-acl"
+SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="udev-acl"
 
 # smart phones
-SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0c02", TAG="udev-acl"
+SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0c02", TAG+="udev-acl"
 
 # color measurement devices
-ENV{COLOR_MEASUREMENT_DEVICE}=="*?", TAG="udev-acl"
+ENV{COLOR_MEASUREMENT_DEVICE}=="*?", TAG+="udev-acl"
 
 # apply ACL for all locally logged in users
 LABEL="acl_apply", TAG=="udev-acl", TEST=="/var/run/ConsoleKit/database", \
index 5965723..6f3335b 100644 (file)
@@ -2442,6 +2442,8 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
                                break;
                        }
                case TK_A_TAG:
+                       if (cur->key.op == OP_ASSIGN || cur->key.op == OP_ASSIGN_FINAL)
+                               udev_device_cleanup_tags_list(event->dev);
                        udev_device_add_tag(event->dev, &rules->buf[cur->key.value_off]);
                        break;
                case TK_A_NAME: