aboutsummaryrefslogtreecommitdiff
path: root/lib/libgeom/geom_xml2tree.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2022-03-16 03:58:09 +0000
committerAlexander Motin <mav@FreeBSD.org>2022-03-16 04:06:49 +0000
commitbd0f3d34fa20686bac9a418d3a37a3f59c25ab19 (patch)
treec0f05fb0e1833ac2cc89cec713eb27911292f10c /lib/libgeom/geom_xml2tree.c
parentf6f357efb1067b79678d8f348333ffdfec66ad20 (diff)
downloadsrc-bd0f3d34fa20686bac9a418d3a37a3f59c25ab19.tar.gz
src-bd0f3d34fa20686bac9a418d3a37a3f59c25ab19.zip
GEOM: Fix regression after 7f16b501e25.
find_geom() in some classes trim leading "/dev/" from geom names. Lack of that in geom_gettree_geom() broke some existing scripts. PR: 262554 MFC after: 2 months
Diffstat (limited to 'lib/libgeom/geom_xml2tree.c')
-rw-r--r--lib/libgeom/geom_xml2tree.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libgeom/geom_xml2tree.c b/lib/libgeom/geom_xml2tree.c
index a6da0e6d163f..52d21790101e 100644
--- a/lib/libgeom/geom_xml2tree.c
+++ b/lib/libgeom/geom_xml2tree.c
@@ -37,6 +37,7 @@
#include <string.h>
#include <unistd.h>
#include <errno.h>
+#include <paths.h>
#include <fcntl.h>
#include <ctype.h>
#include <sys/stat.h>
@@ -481,6 +482,8 @@ geom_gettree_geom(struct gmesh *gmp, const char *c, const char *g, int parents)
char *p;
int error;
+ if (g != NULL && strncmp(g, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0)
+ g += sizeof(_PATH_DEV) - 1;
p = geom_getxml_geom(c, g, parents);
if (p == NULL)
return (errno);