From: Matthew Dillon Date: Fri, 12 Mar 2010 22:43:44 +0000 (-0800) Subject: fstat - Fix path construction for "wd". X-Git-Tag: v2.7.0~94 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/255301128e764dd284d43bd58d2124509ace84af fstat - Fix path construction for "wd". * Fix path construction for "wd", the wrong mount pointer was being used. Reported-by: Alex Hornung --- diff --git a/usr.bin/fstat/fstat.c b/usr.bin/fstat/fstat.c index 5a0eed6e00..964caa02b5 100644 --- a/usr.bin/fstat/fstat.c +++ b/usr.bin/fstat/fstat.c @@ -651,12 +651,16 @@ getmnton(struct mount *m, struct namecache_list *ncplist, struct nchandle *ncr) int i; /* - * If no ncp is passed try to find one via ncplist. + * If no ncp is passed try to find one via ncplist. Make sure + * we are using the correct mount pointer or the matching code + * will not know how to transition mount points properly. */ if (ncr == NULL || ncr->ncp == NULL) { ncp = ncplist->tqh_first; } else { ncp = ncr->ncp; + if (ncr->mount) + m = ncr->mount; } /*