From e0908a9f34dfc9835f1cb5dad1cf2c4cc6466591 Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Tue, 8 Feb 2000 06:36:08 +0000 Subject: [PATCH] Use lstat(2) rather than stat(2) in isdir(), so that a symlink to a directory is not considered a directory. I have a feeling all the other stat(2) calls should instead be lstat(2) calls, but I have not suffiently determined that the current behavior [especially in isfile()] isn't depended upon by someone. Ok'ed by: JKH --- usr.sbin/pkg_install/lib/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c index bc717f9f018..b25dc9ec7dc 100644 --- a/usr.sbin/pkg_install/lib/file.c +++ b/usr.sbin/pkg_install/lib/file.c @@ -47,7 +47,7 @@ isdir(char *fname) { struct stat sb; - if (stat(fname, &sb) != FAIL && S_ISDIR(sb.st_mode)) + if (lstat(fname, &sb) != FAIL && S_ISDIR(sb.st_mode)) return TRUE; else return FALSE;