In the vdev_geom_open_by_path() function we assume that vdev path starts

with "/dev/". Make sure this is the case.
This commit is contained in:
Pawel Jakub Dawidek 2019-02-19 23:22:39 +00:00
parent c90e23db39
commit d793cf7019
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=344314

View File

@ -794,7 +794,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize,
/*
* We must have a pathname, and it must be absolute.
*/
if (vd->vdev_path == NULL || vd->vdev_path[0] != '/') {
if (vd->vdev_path == NULL || strncmp(vd->vdev_path, "/dev/", 5) != 0) {
vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL;
return (EINVAL);
}