summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/lib
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1998-10-09 00:01:16 +0000
committerjkh <jkh@FreeBSD.org>1998-10-09 00:01:16 +0000
commit1f21e28dc65a305fd2bd4e5192d900026b17bd76 (patch)
treefdc8ae8f51455c20d7b1541e7d46cb21857b336c /usr.sbin/pkg_install/lib
parentababcfc8845332ecadd2641267d23ec3bcdab474 (diff)
downloadFreeBSD-src-1f21e28dc65a305fd2bd4e5192d900026b17bd76.zip
FreeBSD-src-1f21e28dc65a305fd2bd4e5192d900026b17bd76.tar.gz
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 <ru@ucb.crimea.ua>
Diffstat (limited to 'usr.sbin/pkg_install/lib')
-rw-r--r--usr.sbin/pkg_install/lib/file.c4
1 files changed, 2 insertions, 2 deletions
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;
OpenPOWER on IntegriCloud