From 1f21e28dc65a305fd2bd4e5192d900026b17bd76 Mon Sep 17 00:00:00 2001 From: jkh Date: Fri, 9 Oct 1998 00:01:16 +0000 Subject: Use lstat() rather than stat in determining whether a file exists, otherwise we'll miss the "symlink exists but points nowhere" case. Submitted by: asami and/or possibly --- usr.sbin/pkg_install/lib/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.sbin/pkg_install/lib') diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c index 6d38321..760f777 100644 --- a/usr.sbin/pkg_install/lib/file.c +++ b/usr.sbin/pkg_install/lib/file.c @@ -1,6 +1,6 @@ #ifndef lint static const char rcsid[] = - "$Id: file.c,v 1.31 1998/09/08 10:42:26 jkh Exp $"; + "$Id: file.c,v 1.32 1998/09/11 07:26:58 jkh Exp $"; #endif /* @@ -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; -- cgit v1.1