mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-02-10 13:57:25 +03:00
core: be a bit stricter when validating SYSTEMD_ALIAS udev props
This commit is contained in:
parent
b8b846d7b4
commit
a7f8be01aa
@ -579,10 +579,12 @@ static int device_process_new(Manager *m, struct udev_device *dev) {
|
||||
if (r < 0)
|
||||
return log_warning_errno(r, "Failed to add parse SYSTEMD_ALIAS for %s: %m", sysfs);
|
||||
|
||||
if (path_is_absolute(word))
|
||||
(void) device_setup_unit(m, dev, word, false);
|
||||
else
|
||||
if (!path_is_absolute(word))
|
||||
log_warning("SYSTEMD_ALIAS for %s is not an absolute path, ignoring: %s", sysfs, word);
|
||||
else if (!path_is_normalized(word))
|
||||
log_warning("SYSTEMD_ALIAS for %s is not a normalized path, ignoring: %s", sysfs, word);
|
||||
else
|
||||
(void) device_setup_unit(m, dev, word, false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user