summaryrefslogtreecommitdiffstats
path: root/plugins/udev.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/udev.c')
-rw-r--r--plugins/udev.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/udev.c b/plugins/udev.c
index 6720a0cd..38a63127 100644
--- a/plugins/udev.c
+++ b/plugins/udev.c
@@ -24,6 +24,7 @@
#endif
#include <errno.h>
+#include <ctype.h>
#include <libudev.h>
@@ -86,8 +87,14 @@ static const char *get_serial(struct udev_device *udev_device)
entry = udev_list_entry_get_next(entry);
}
- if (serial && strpbrk(serial, ".-_?*") != NULL)
- return NULL;
+ if (serial != NULL) {
+ unsigned int i, len = strlen(serial);
+
+ for (i = 0; i < len; i++) {
+ if (!isalnum(serial[i]))
+ return NULL;
+ }
+ }
return serial;
}