diff --git a/pam_usb/src/conf.c b/pam_usb/src/conf.c index e8b0aa1..8775809 100644 --- a/pam_usb/src/conf.c +++ b/pam_usb/src/conf.c @@ -107,12 +107,10 @@ static int pusb_conf_device_get_property(t_pusb_options *opts, static int pusb_conf_parse_device(t_pusb_options *opts, xmlDoc *doc) { - if (!pusb_conf_device_get_property(opts, doc, "vendor", opts->device.vendor, - sizeof(opts->device.vendor))) - return (0); - if (!pusb_conf_device_get_property(opts, doc, "model", opts->device.model, - sizeof(opts->device.model))) - return (0); + pusb_conf_device_get_property(opts, doc, "vendor", opts->device.vendor, + sizeof(opts->device.vendor)); + pusb_conf_device_get_property(opts, doc, "model", opts->device.model, + sizeof(opts->device.model)); if (!pusb_conf_device_get_property(opts, doc, "serial", opts->device.serial, sizeof(opts->device.serial))) return (0); diff --git a/pam_usb/src/hal.c b/pam_usb/src/hal.c index c19c351..793fe7f 100644 --- a/pam_usb/src/hal.c +++ b/pam_usb/src/hal.c @@ -161,7 +161,7 @@ char *pusb_hal_find_item(LibHalContext *ctx, for (i = 0; i < n_devices; ++i) { char *key = NULL; - int match = 1; + int match = 1; va_start(ap, value); while ((key = va_arg(ap, char *))) @@ -169,6 +169,8 @@ char *pusb_hal_find_item(LibHalContext *ctx, char *value = NULL; value = va_arg(ap, char *); + if (!value || *value == 0x0) + continue ; if (!pusb_hal_check_property(ctx, devices[i], key, value)) {