diff options
author | jkh <jkh@FreeBSD.org> | 1998-10-09 00:01:16 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1998-10-09 00:01:16 +0000 |
commit | 1f21e28dc65a305fd2bd4e5192d900026b17bd76 (patch) | |
tree | fdc8ae8f51455c20d7b1541e7d46cb21857b336c | |
parent | ababcfc8845332ecadd2641267d23ec3bcdab474 (diff) | |
download | FreeBSD-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>
-rw-r--r-- | usr.sbin/pkg_install/lib/file.c | 4 |
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; |