[patches] Add dmi kernel class support into HAL

Lennart Poettering mzuny at 0pointer.de
Tue Jun 5 09:01:43 PDT 2007


On Tue, 05.06.07 11:05, David Zeuthen (david at fubar.dk) wrote:

> 
> On Mon, 2007-06-04 at 18:55 +0100, Richard Hughes wrote:
> > On Mon, 2007-06-04 at 17:01 +0200, Lennart Poettering wrote:
> > > lspci and lsusb maintain ther databases outside of the kernel. And I
> > > think this case is not that different.
> > 
> > Patch attached. Please review.
> 
> How does this cope with some of the dmi sysfs files only being readable
> by uid 0? Or has that changed? 

No this hasn't changed upstream.

BTW: One question, Richard: In dmi_set_string_from_data() you test
strcmp(value, "Not Available"). Why? That string has no special
meaning according to the DMI spec, AFAIK. Different BIOSes use
different strings for not-availability here. e.g. my asus mainboard
just repeats the field name in the field data. 

The only extra check that might make sense is to check whether the
field is left empty or consists of whitespace only. Some check like
this:

strlen(value) == strcspn(value, " \t\r\n")

Which reminds me that the BIOS strings are not necessarily UTF-8
strings. HAL assume UTF8, doesn't it? Maybe you should strip all
non-ASCII characters from it.

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4


More information about the hal mailing list