[PATCH] fix segfault in hal-storage-mount and don't lose fstype in probe-volume

Kay Sievers kay.sievers at vrfy.org
Sun May 24 08:48:17 PDT 2009


On Sun, May 24, 2009 at 11:31, Simon Munton
<simon-hal at munton.demon.co.uk> wrote:
> Attached patch checks that return value of libhal_volume_get_fstype() is not
> NULL before being passed to strcmp() in hal-storage-mount.c

Looks fine.

> It also changes:
>
> if (libhal_changeset_set_property_string (cs, "volume.fstype", type))
>
> to
>
> if (!libhal_changeset_set_property_string (cs, "volume.fstype", type))
>
> in hald/linux/probing/probe-volume.c.
>
> This is how it was in 0.5.11, the change made in 0.5.12 causes
> libhal_changeset_set_property_string() to be called twice for "volume.fstype",
> the second time the the type is an empty string, which then makes hal lose the
> fstype.
>
> This appears to be the only time the return value of
> libhal_changeset_set_property_string() is checked; all other calls don't
> check, perhaps this instance should be changed to not check too?

Please remove the entire line with the "" string and the return value
check. The empty type string should be handled just fine in the logic
above.

Thanks,
Kay


More information about the hal mailing list