summaryrefslogtreecommitdiff
path: root/usr/src/lib/libproc/common/Pzone.c
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2013-08-23 20:27:11 +0000
committerRobert Mustacchi <rm@joyent.com>2014-03-23 21:50:28 -0700
commitb00e809c3e9ef3c14558dfdbbc80115ede90be81 (patch)
tree547bd9e65de43c0709aa5e26ba2cba9cf9a3d1f8 /usr/src/lib/libproc/common/Pzone.c
parent4948216cdd0ccee7b9a4fd433ccab571afbb99e9 (diff)
downloadillumos-joyent-b00e809c3e9ef3c14558dfdbbc80115ede90be81.tar.gz
3750 ptools fail an assertion if libraries are lofs mountpoints
Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Richard Lowe <richlowe@richlowe.net> Reviewed by: Dan McDonald <danmcd@omniti.com> Approved by: Dan McDonald <danmcd@omniti.com>
Diffstat (limited to 'usr/src/lib/libproc/common/Pzone.c')
-rw-r--r--usr/src/lib/libproc/common/Pzone.c19
1 files changed, 13 insertions, 6 deletions
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 */