1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-26 03:22:00 +03:00

prevent wrong symlink creation if database disagress with current rules

This commit is contained in:
Kay Sievers 2007-09-20 19:38:58 +02:00
parent 18770246ed
commit b2d1ae727e

View File

@ -218,14 +218,16 @@ static int update_link(struct udevice *udev, const char *name)
if (strcmp(udev->dev->devpath, device->name) == 0) { if (strcmp(udev->dev->devpath, device->name) == 0) {
info("compare (our own) priority of '%s' %i >= %i", info("compare (our own) priority of '%s' %i >= %i",
udev->dev->devpath, udev->link_priority, priority); udev->dev->devpath, udev->link_priority, priority);
if (target[0] == '\0' || udev->link_priority >= priority) { if (strcmp(udev->name, name) == 0) {
info("'%s' is our device node, database inconsistent, skip link update", udev->name);
} else if (target[0] == '\0' || udev->link_priority >= priority) {
priority = udev->link_priority; priority = udev->link_priority;
strlcpy(target, udev->name, sizeof(target)); strlcpy(target, udev->name, sizeof(target));
} }
continue; continue;
} }
/* or something else, then read priority from database */ /* another device, read priority from database */
udev_db = udev_device_init(NULL); udev_db = udev_device_init(NULL);
if (udev_db == NULL) if (udev_db == NULL)
continue; continue;