sd-device: use string_is_safe() at one more place

This commit is contained in:
Yu Watanabe
2026-05-18 01:57:33 +09:00
parent 42c689f63d
commit 8e8d3a22b2
+4 -5
View File
@@ -31,7 +31,6 @@
#include "string-util.h"
#include "strv.h"
#include "time-util.h"
#include "utf8.h"
int device_new_aux(sd_device **ret) {
sd_device *device;
@@ -97,10 +96,10 @@ static bool property_is_valid(const char *key, const char *value) {
return true;
/* refuse invalid UTF8 and control characters */
if (!utf8_is_valid(value) || string_has_cc(value, /* ok= */ NULL))
return false;
return true;
return string_is_safe(value,
STRING_ALLOW_BACKSLASHES |
STRING_ALLOW_QUOTES |
STRING_ALLOW_GLOBS);
}
int device_add_property_aux(sd_device *device, const char *key, const char *value, bool db) {