hal: Branch 'master' - 9 commits

Danny Kukawka dkukawka at kemper.freedesktop.org
Fri May 15 05:15:17 PDT 2009


 configure.in                                    |    2 -
 doc/spec/hal-spec-access-control.xml            |    8 +++++
 doc/spec/hal-spec-properties.xml                |   35 ++++++++++++++++++++++++
 fdi/policy/10osvendor/10-smartcardreaders.fdi   |   16 ----------
 fdi/policy/10osvendor/10-tabletPCs.fdi          |   15 ++--------
 fdi/policy/10osvendor/20-acl-management.fdi     |   10 ++++++
 fdi/policy/10osvendor/Makefile.am               |    1 
 hald/linux/device.c                             |   13 ++++++++
 policy/org.freedesktop.hal.device-access.policy |   18 ++++++------
 9 files changed, 79 insertions(+), 39 deletions(-)

New commits:
commit f920b2ea40ef8741036740c4eb13a8584a5a8238
Merge: 1579cce... f8866e7...
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Fri May 15 13:32:50 2009 +0200

    Merge branch 'master' of ssh://dkukawka@people.freedesktop.org/~dkukawka/hal

commit 1579ccee0c25606c39e831b98c129c54ec3894ae
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Fri May 15 13:27:50 2009 +0200

    Revert "add ACL policy for smartcard readers"
    
    This reverts commit a18f69ea0d1a100bf85925b81acd0539f564eae6.
    
    Smartcard reader are handled by the openSC package as discussed in
    fd.o#19663. Don't add additional rules to hal, the package should
    deliver a fdi file with the needed information.

diff --git a/fdi/policy/10osvendor/10-smartcardreaders.fdi b/fdi/policy/10osvendor/10-smartcardreaders.fdi
deleted file mode 100644
index 1c9388a..0000000
--- a/fdi/policy/10osvendor/10-smartcardreaders.fdi
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<deviceinfo version="0.2">
-  <device>
-    <match key="info.subsystem" string="usb">
-      <!-- SCM SPR 335, SPR 532 -->
-      <match key="usb.vendor_id" int="0x4e6">
-        <match key="usb.product_id" int_outof="0x5115;0xe001;0xe003">
-          <append key="info.capabilities" type="strlist">access_control</append>
-          <merge key="access_control.file" type="copy_property">@info.parent:linux.device_file</merge>
-          <merge key="access_control.type" type="string">smart-card-reader</merge>
-        </match>
-      </match>
-    </match>
-  </device>
-</deviceinfo>
diff --git a/fdi/policy/10osvendor/Makefile.am b/fdi/policy/10osvendor/Makefile.am
index 5a19795..67c021c 100644
--- a/fdi/policy/10osvendor/Makefile.am
+++ b/fdi/policy/10osvendor/Makefile.am
@@ -8,7 +8,6 @@ dist_fdi_DATA = 			\
 	10-leds.fdi			\
 	10-power-mgmt-policy.fdi	\
 	10-rfkill-switch.fdi		\
-	10-smartcardreaders.fdi		\
 	10-tabletPCs.fdi		\
 	10-x11-input.fdi		\
 	15-storage-luks.fdi		\
diff --git a/policy/org.freedesktop.hal.device-access.policy b/policy/org.freedesktop.hal.device-access.policy
index 7643a3e..e083eb4 100644
--- a/policy/org.freedesktop.hal.device-access.policy
+++ b/policy/org.freedesktop.hal.device-access.policy
@@ -199,13 +199,4 @@ NOTE: Please keep the actions in alpabetical order
     </defaults>
   </action>
 
-  <action id="org.freedesktop.hal.device-access.smart-card-reader">
-    <description>Directly access smart-card readers</description>
-    <message>System policy prevents access to the smart-card readers</message>
-    <defaults>
-      <allow_inactive>no</allow_inactive>
-      <allow_active>yes</allow_active>
-    </defaults>
-  </action>
-
 </policyconfig>
commit f8866e7193e3f9d95e4a36cd08bb69ffc21fbaff
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Wed Mar 18 18:21:52 2009 +0100

    fix sound_compute_udi(): sound.card is int and not a string
    
    Fixed sound_compute_udi(). The type of property sound.card
    is int and not string, use the correct function to get the value.

diff --git a/hald/linux/device.c b/hald/linux/device.c
index 1b3316a..02c456f 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -3496,7 +3496,7 @@ sound_compute_udi (HalDevice *d)
 		hald_compute_udi (udi, sizeof (udi),
 				  "%s_sound_card_%i",
 				  hal_device_property_get_string (d, "info.parent"),
-				  hal_device_property_get_string (d, "sound.card"));
+				  hal_device_property_get_int (d, "sound.card"));
 	} else if (hal_device_has_property(d, "alsa.card")) {
 		/* don't include card number as it may not be persistent across reboots */
 		hald_compute_udi (udi, sizeof (udi),
commit 999818f10b45cf516dc7e828d2f7e2cbe615cae3
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Wed Mar 18 17:30:53 2009 +0100

    ignore ADD events if there is already a device with same sysfs_path
    
    Ignore ADD events if there is already a device with the same
    syfs_path available in the GDL or TDL. This should prevent
    problems getting duplicated devices from calling 'udevadm trigger'
    (fd.o#18861) or from some other rare cases (see:
    http://lists.freedesktop.org/archives/hal/2009-February/012954.html).
    
    TODO: Check if it make sense to call a refresh for the already
          existing device instead of ignoring the event completely.

diff --git a/hald/linux/device.c b/hald/linux/device.c
index 6653782..1b3316a 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -4829,11 +4829,22 @@ hotplug_event_begin_add_dev (const gchar *subsystem, const gchar *sysfs_path, co
 		handler = dev_handlers[i];
 		if (strcmp (handler->subsystem, subsystem) == 0) {
 			HalDevice *d;
+			HalDevice *check;
 
 			if (strcmp (subsystem, "scsi") == 0)
 				if (missing_scsi_host (sysfs_path, (HotplugEvent *)end_token, HOTPLUG_ACTION_ADD))
 					goto out;
 
+			/* check if there is already a device with this sysfs_path in the system */
+			if ((check = hal_device_store_match_key_value_string (hald_get_gdl (), "linux.sysfs_path", sysfs_path)) != NULL ||
+			    (check = hal_device_store_match_key_value_string (hald_get_tdl (), "linux.sysfs_path", sysfs_path)) != NULL) {
+				HAL_WARNING(("Have already a device with sysfs_path='%s' and udi='%s'. Ignore new add event for now.", 
+					     sysfs_path, hal_device_get_udi(check)));
+				/* maybe we should do a refresh on the found device ??? */
+				hotplug_event_end (end_token);
+				goto out; 
+			}
+
 			/* attempt to add the device */
 			d = handler->add (sysfs_path, device_file, parent_dev, parent_path);
 			if (d == NULL) {
commit 7123ef9a78c8c6b504e6ba98218fc556641a458c
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Mon Mar 2 19:43:29 2009 +0100

    define ACL and device-access policy for smart_card_reader
    
    Defined ACL and device-access policy for smart_card_reader. Added
    information to the spec.

diff --git a/doc/spec/hal-spec-access-control.xml b/doc/spec/hal-spec-access-control.xml
index b33bd18..1846d37 100644
--- a/doc/spec/hal-spec-access-control.xml
+++ b/doc/spec/hal-spec-access-control.xml
@@ -138,6 +138,14 @@
             </row>
             <row>
               <entry>
+                <literal>smart-card-reader</literal>
+              </entry>
+              <entry>Directly access Smart Card Reader security devices.</entry>
+	      <entry>no</entry>
+	      <entry>yes</entry>
+            </row>
+            <row>
+              <entry>
                 <literal>joystick</literal>
               </entry>
               <entry>Directly access Joystick devices.</entry>
diff --git a/fdi/policy/10osvendor/20-acl-management.fdi b/fdi/policy/10osvendor/20-acl-management.fdi
index 2884a12..fc609ff 100644
--- a/fdi/policy/10osvendor/20-acl-management.fdi
+++ b/fdi/policy/10osvendor/20-acl-management.fdi
@@ -73,6 +73,11 @@
 	  <merge key="access_control.file" type="copy_property">usbraw.device</merge>
 	  <merge key="access_control.type" type="string">fingerprint-reader</merge>
         </match>
+        <match key="info.capabilities" sibling_contains="smart_card_reader">
+	  <addset key="info.capabilities" type="strlist">access_control</addset>
+	  <merge key="access_control.file" type="copy_property">usbraw.device</merge>
+	  <merge key="access_control.type" type="string">smart-card-reader</merge>
+        </match>
       </match>
     </match>
 
@@ -104,6 +109,11 @@
           <merge key="access_control.type" type="string">fingerprint-reader</merge>
           <merge key="access_control.file" type="copy_property">@info.parent:linux.device_file</merge>
         </match>
+        <match key="info.capabilities" contains="smart_card_reader">
+          <addset key="info.capabilities" type="strlist">access_control</addset>
+          <merge key="access_control.type" type="string">smart-card-reader</merge>
+          <merge key="access_control.file" type="copy_property">@info.parent:linux.device_file</merge>
+        </match>
       </match>
     </match>
 
diff --git a/policy/org.freedesktop.hal.device-access.policy b/policy/org.freedesktop.hal.device-access.policy
index e083eb4..884fa57 100644
--- a/policy/org.freedesktop.hal.device-access.policy
+++ b/policy/org.freedesktop.hal.device-access.policy
@@ -91,6 +91,15 @@ NOTE: Please keep the actions in alpabetical order
     </defaults>
   </action>
 
+  <action id="org.freedesktop.hal.device-access.smart-card-reader">
+    <description>Directly access to Smart Card Reader security devices</description>
+    <message>System policy prevents access to Smart Card Reader security devices</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
+
   <action id="org.freedesktop.hal.device-access.joystick">
     <description>Directly access Joystick devices</description>
     <message>System policy prevents access to Joystick devices</message>
commit 0f2d03c492f32428e8ca3a72ce52ecf2fcdfa780
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Mon Mar 2 19:40:51 2009 +0100

    define new (sub-)namespace(s) for smart card reader
    
    Defined new (sub-)namespace(s) for smart card reader as discussed in
    fd.o#19663 and opensc:
    - smart_card_reader
    - smart_card_reader.card_reader (for smart card reader)
    - smart_card_reader.crypto_token (for smart/crypto token devices)

diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index d06e970..db7abee 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -6248,6 +6248,41 @@ org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}
       </informaltable>
     </sect2>
 
+    <sect2 id="device-properties-smart_card_reader">
+      <title>
+        smart_card_reader namespace
+      </title>
+      <para>
+	Device objects with the capability <literal>smart_card_reader</literal> represent
+	a smart card device/systems (e.g. smart card reader) . No namespace specific
+        properties.
+      </para>
+    </sect2>
+
+    <sect2 id="device-properties-smart_card_reader-card_reader">
+      <title>
+        smart_card_reader.card_reader namespace
+      </title>
+      <para>
+	Device objects with the capabilities <literal>smart_card_reader</literal>
+	and <literal>smart_card_reader.card_reader</literal> represent a 
+	smart card reader. No namespace specific properties.
+      </para>
+    </sect2>
+
+    <sect2 id="device-properties-smart_card_reader-crypto_token">
+      <title>
+        smart_card_reader.crypto_token namespace
+      </title>
+      <para>
+	Device objects with the capabilities <literal>smart_card_reader</literal> and 
+	<literal>smart_card_reader.crypto_token</literal> represent a smart token, a 
+	device where the smart card and the smart card reader are in one device. No 
+	namespace specific properties.
+      </para>
+    </sect2>
+
+
     <sect2 id="device-properties-storage">
       <title>
         storage namespace
commit 3ee72db0f7b2690972026db7292e1c486750c0f4
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Sat Feb 28 15:56:05 2009 +0100

    set default udev_prefix to ${exec_prefix}/lib in configure.in
    
    Set default udev_prefix to ${exec_prefix}/lib in configure.in to
    get by default ${exec_prefix}/lib/udev/rules.d as the actual
    udev package use. Use --with-udev-prefix to change the path if
    needed.

diff --git a/configure.in b/configure.in
index 0630d60..bf26dd2 100644
--- a/configure.in
+++ b/configure.in
@@ -76,7 +76,7 @@ AC_ARG_WITH([socket-dir],
 
 AC_ARG_WITH(udev-prefix,
         AS_HELP_STRING([--with-udev-prefix=DIR], [add prefix to internal udev path names]),
-        [], [with_udev_prefix='${exec_prefix}'])
+        [], [with_udev_prefix='${exec_prefix}/lib'])
 udev_prefix=$with_udev_prefix
 AC_SUBST(udev_prefix)
 
commit 4fa6ede74c353bd15c672286ac9e15822d9b1a6c
Merge: 2194d9e... b964fa1...
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Sat Feb 28 15:51:19 2009 +0100

    Merge branch 'master' of ssh://dkukawka@git.freedesktop.org/git/hal

commit 2194d9ee0fe4c5f4f5235b3018aa01b4403d6da5
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Thu Feb 26 09:31:09 2009 +0100

    remove special serial tablet handling for HP tc4200
    
    Removed special serial tablet handling for HP tc4200. The
    kernel should handle this correctly, otherwise we have to fix
    the kernel or add a new workaround.

diff --git a/fdi/policy/10osvendor/10-tabletPCs.fdi b/fdi/policy/10osvendor/10-tabletPCs.fdi
index eaa8058..ccb51f3 100644
--- a/fdi/policy/10osvendor/10-tabletPCs.fdi
+++ b/fdi/policy/10osvendor/10-tabletPCs.fdi
@@ -3,17 +3,10 @@
 <deviceinfo version="0.2">
 
   <device>
-    <match key="info.capabilities" contains="input.tablet.tabletPC">
-      <!-- There is a report that we should use ttyS2 instead of ttyS0 -->
-      <match key="/org/freedesktop/Hal/devices/computer:system.hardware.product" contains="HP Compaq tc4200">
-	<merge key="input.device.set" type="string">/dev/ttyS2</merge>
-      </match>
-
-      <!-- to get the device up we need to set the baud_rate correct -->
-      <match key="pnp.id" contains="FPI2004">
-	<merge key="input.device.set" type="string">/dev/ttyS0</merge>
-	<merge key="pnp.serial.baud_base" type="int">38400</merge>
-      </match>
+    <!-- to get the device up we need to set the baud_rate correct -->
+    <match key="pnp.id" contains="FPI2004">
+      <merge key="input.device.set" type="string">/dev/ttyS0</merge>
+      <merge key="pnp.serial.baud_base" type="int">38400</merge>
     </match>
 
     <!-- add addon if need special ttySx settings -->


More information about the hal-commit mailing list