chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
systemctl: fix a leak
[elogind.git]
/
src
/
udev
/
udev-builtin-path_id.c
diff --git
a/src/udev/udev-builtin-path_id.c
b/src/udev/udev-builtin-path_id.c
index 073f05aac31c733752cbccc1d3435750d971b93d..df996cb17aca160fd4496b6769adf82a62f52826 100644
(file)
--- a/
src/udev/udev-builtin-path_id.c
+++ b/
src/udev/udev-builtin-path_id.c
@@
-332,7
+332,7
@@
static struct udev_device *handle_scsi_hyperv(struct udev_device *parent, char *
return parent;
}
return parent;
}
-static struct udev_device *handle_scsi(struct udev_device *parent, char **path) {
+static struct udev_device *handle_scsi(struct udev_device *parent, char **path
, bool *supported_parent
) {
const char *devtype;
const char *name;
const char *id;
const char *devtype;
const char *name;
const char *id;
@@
-346,6
+346,7
@@
static struct udev_device *handle_scsi(struct udev_device *parent, char **path)
if (id != NULL) {
parent = skip_subsystem(parent, "scsi");
path_prepend(path, "ieee1394-0x%s", id);
if (id != NULL) {
parent = skip_subsystem(parent, "scsi");
path_prepend(path, "ieee1394-0x%s", id);
+ *supported_parent = true;
goto out;
}
goto out;
}
@@
-354,16
+355,19
@@
static struct udev_device *handle_scsi(struct udev_device *parent, char **path)
if (strstr(name, "/rport-") != NULL) {
parent = handle_scsi_fibre_channel(parent, path);
if (strstr(name, "/rport-") != NULL) {
parent = handle_scsi_fibre_channel(parent, path);
+ *supported_parent = true;
goto out;
}
if (strstr(name, "/end_device-") != NULL) {
parent = handle_scsi_sas(parent, path);
goto out;
}
if (strstr(name, "/end_device-") != NULL) {
parent = handle_scsi_sas(parent, path);
+ *supported_parent = true;
goto out;
}
if (strstr(name, "/session") != NULL) {
parent = handle_scsi_iscsi(parent, path);
goto out;
}
if (strstr(name, "/session") != NULL) {
parent = handle_scsi_iscsi(parent, path);
+ *supported_parent = true;
goto out;
}
goto out;
}
@@
-502,7
+506,7
@@
static int builtin_path_id(struct udev_device *dev, int argc, char *argv[], bool
} else if (streq(subsys, "scsi_tape")) {
handle_scsi_tape(parent, &path);
} else if (streq(subsys, "scsi")) {
} else if (streq(subsys, "scsi_tape")) {
handle_scsi_tape(parent, &path);
} else if (streq(subsys, "scsi")) {
- parent = handle_scsi(parent, &path);
+ parent = handle_scsi(parent, &path
, &supported_parent
);
supported_transport = true;
} else if (streq(subsys, "cciss")) {
parent = handle_cciss(parent, &path);
supported_transport = true;
} else if (streq(subsys, "cciss")) {
parent = handle_cciss(parent, &path);
@@
-544,9
+548,9
@@
static int builtin_path_id(struct udev_device *dev, int argc, char *argv[], bool
}
/*
}
/*
- * Do
return devices with have an unknown type of parent device, t
hey
- * might produce conflicting IDs
below multiple independent parent
- *
devices
.
+ * Do
not return devices with an unknown parent device type. T
hey
+ * might produce conflicting IDs
if the parent does not provide a
+ *
unique and predictable name
.
*/
if (!supported_parent) {
free(path);
*/
if (!supported_parent) {
free(path);
@@
-554,9
+558,9
@@
static int builtin_path_id(struct udev_device *dev, int argc, char *argv[], bool
}
/*
}
/*
- * Do not return
a have-only a single-parent block devices, s
ome
- *
have entire hidden buses behind it, and not create predictabl
e
- *
IDs
that way.
+ * Do not return
block devices without a well-known transport. S
ome
+ *
devices do not expose their buses and do not provide a uniqu
e
+ *
and predictable name
that way.
*/
if (streq(udev_device_get_subsystem(dev), "block") && !supported_transport) {
free(path);
*/
if (streq(udev_device_get_subsystem(dev), "block") && !supported_transport) {
free(path);