From 1e9d8f9f40b034b8ec51ffb485e216edd7d9ea77 Mon Sep 17 00:00:00 2001 From: dminer Date: Thu, 9 Nov 2006 08:35:31 -0800 Subject: 6489671 lumount problems after luupgrade --- usr/src/cmd/zoneadmd/vplat.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'usr/src') diff --git a/usr/src/cmd/zoneadmd/vplat.c b/usr/src/cmd/zoneadmd/vplat.c index dfb1a4ef77..ca93b1c696 100644 --- a/usr/src/cmd/zoneadmd/vplat.c +++ b/usr/src/cmd/zoneadmd/vplat.c @@ -304,19 +304,22 @@ resolve_lofs(zlog_t *zlogp, char *path, size_t pathlen) for (;;) { struct mnttab *mnp; - for (mnp = resolve_lofs_mnts; mnp < resolve_lofs_mnt_max; - mnp++) { + /* Search in reverse order to find longest match */ + for (mnp = resolve_lofs_mnt_max - 1; mnp >= resolve_lofs_mnts; + mnp--) { if (mnp->mnt_fstype == NULL || mnp->mnt_mountp == NULL || - mnp->mnt_special == NULL || - strcmp(mnp->mnt_fstype, MNTTYPE_LOFS) != 0) + mnp->mnt_special == NULL) continue; len = strlen(mnp->mnt_mountp); if (strncmp(mnp->mnt_mountp, path, len) == 0 && (path[len] == '/' || path[len] == '\0')) break; } - if (mnp >= resolve_lofs_mnt_max) + if (mnp < resolve_lofs_mnts) + break; + /* If it's not a lofs then we're done */ + if (strcmp(mnp->mnt_fstype, MNTTYPE_LOFS) != 0) break; if (outside_altroot) { char *cp; -- cgit v1.2.3