- if (!path_startswith(path, "/dev"))
- return sd_bus_error_set_errnof(error, EINVAL, "DeviceAllow= requires device node");
+ if ((!startswith(path, "/dev/") &&
+ !startswith(path, "block-") &&
+ !startswith(path, "char-")) ||
+ strpbrk(path, WHITESPACE))
+ return sd_bus_error_set_errnof(error, EINVAL, "DeviceAllow= requires device node");