diff options
author | Danny Kukawka <danny.kukawka@web.de> | 2009-05-15 13:32:50 +0200 |
---|---|---|
committer | Danny Kukawka <danny.kukawka@web.de> | 2009-05-15 13:32:50 +0200 |
commit | f920b2ea40ef8741036740c4eb13a8584a5a8238 (patch) | |
tree | 0e863b52ea484a87de3eb0d663e158ef924843e9 | |
parent | 1579ccee0c25606c39e831b98c129c54ec3894ae (diff) | |
parent | f8866e7193e3f9d95e4a36cd08bb69ffc21fbaff (diff) |
Merge branch 'master' of ssh://dkukawka@people.freedesktop.org/~dkukawka/hal
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | doc/spec/hal-spec-access-control.xml | 8 | ||||
-rw-r--r-- | doc/spec/hal-spec-properties.xml | 35 | ||||
-rw-r--r-- | fdi/policy/10osvendor/10-tabletPCs.fdi | 15 | ||||
-rw-r--r-- | fdi/policy/10osvendor/20-acl-management.fdi | 10 | ||||
-rw-r--r-- | hald/linux/device.c | 13 | ||||
-rw-r--r-- | policy/org.freedesktop.hal.device-access.policy | 9 |
7 files changed, 79 insertions, 13 deletions
diff --git a/configure.in b/configure.in index c37742ba..87d150e1 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) diff --git a/doc/spec/hal-spec-access-control.xml b/doc/spec/hal-spec-access-control.xml index b33bd189..1846d377 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/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml index d06e9704..db7abee2 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 diff --git a/fdi/policy/10osvendor/10-tabletPCs.fdi b/fdi/policy/10osvendor/10-tabletPCs.fdi index eaa8058f..ccb51f33 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 --> diff --git a/fdi/policy/10osvendor/20-acl-management.fdi b/fdi/policy/10osvendor/20-acl-management.fdi index 2884a12c..fc609ff5 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/hald/linux/device.c b/hald/linux/device.c index 66537823..02c456f7 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), @@ -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) { diff --git a/policy/org.freedesktop.hal.device-access.policy b/policy/org.freedesktop.hal.device-access.policy index e083eb49..884fa57b 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> |