summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/lib
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2000-02-08 06:36:08 +0000
committerobrien <obrien@FreeBSD.org>2000-02-08 06:36:08 +0000
commitbcb32823be5f02644ad81cf37952accd5b07a80f (patch)
tree52e5f8830570ebd7ccf85de3072d75c368cf546d /usr.sbin/pkg_install/lib
parent63ef3be5d669e165f90e2d89ee573360bf7bc754 (diff)
downloadFreeBSD-src-bcb32823be5f02644ad81cf37952accd5b07a80f.zip
FreeBSD-src-bcb32823be5f02644ad81cf37952accd5b07a80f.tar.gz
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
Diffstat (limited to 'usr.sbin/pkg_install/lib')
-rw-r--r--usr.sbin/pkg_install/lib/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c
index bc717f9..b25dc9e 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;
OpenPOWER on IntegriCloud