Author: mav
Date: Tue Jun 11 13:28:41 2019
New Revision: 348901
URL: https://svnweb.freebsd.org/changeset/base/348901

Log:
  MFC r344314 (by pjd):
  In the vdev_geom_open_by_path() function we assume that vdev path starts
  with "/dev/". Make sure this is the case.

Modified:
  stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==============================================================================
--- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c        
Tue Jun 11 11:23:15 2019        (r348900)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c        
Tue Jun 11 13:28:41 2019        (r348901)
@@ -794,7 +794,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psize, uint64_t *
        /*
         * 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);
        }
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to