From b00e809c3e9ef3c14558dfdbbc80115ede90be81 Mon Sep 17 00:00:00 2001 From: Jerry Jelinek Date: Fri, 23 Aug 2013 20:27:11 +0000 Subject: 3750 ptools fail an assertion if libraries are lofs mountpoints Reviewed by: Robert Mustacchi Reviewed by: Richard Lowe Reviewed by: Dan McDonald Approved by: Dan McDonald --- usr/src/lib/libproc/common/Pzone.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'usr/src/lib/libproc/common/Pzone.c') diff --git a/usr/src/lib/libproc/common/Pzone.c b/usr/src/lib/libproc/common/Pzone.c index 67a8c0b3c9..3c4999bbe4 100644 --- a/usr/src/lib/libproc/common/Pzone.c +++ b/usr/src/lib/libproc/common/Pzone.c @@ -387,16 +387,23 @@ Plofspath(const char *path, char *s, size_t n) * lofs resolution loop. Use resolvepath() to make * sure there are no consecutive or trailing '/'s * in the path. + * + * However, we need to be careful to handle the case of + * a lofs mounted file under a lofs mounted file system. + * In this case, we just keep going. */ + (void) strlcpy(tmp2, special, sizeof (tmp2) - 1); (void) strlcat(tmp2, "/", sizeof (tmp2) - 1); (void) strlcat(tmp2, &p[1], sizeof (tmp2) - 1); - (void) strlcpy(tmp, tmp2, sizeof (tmp) - 1); - if ((rv = resolvepath(tmp, tmp, sizeof (tmp) - 1)) >= 0) - tmp[rv] = '\0'; - p = &tmp[strlen(tmp)]; - p[1] = '\0'; - continue; + if ((rv = resolvepath(tmp2, tmp2, sizeof (tmp2) - 1)) >= + 0) { + tmp2[rv] = '\0'; + (void) strlcpy(tmp, tmp2, sizeof (tmp) - 1); + p = &tmp[strlen(tmp)]; + p[1] = '\0'; + continue; + } } /* No lofs mount found */ -- cgit v1.2.3