diff options
author | David E. O'Brien <obrien@FreeBSD.org> | 2000-02-08 06:36:08 +0000 |
---|---|---|
committer | David E. O'Brien <obrien@FreeBSD.org> | 2000-02-08 06:36:08 +0000 |
commit | e0908a9f34dfc9835f1cb5dad1cf2c4cc6466591 (patch) | |
tree | 9667540e0188ebef0b89550918e3212180c706e5 /usr.sbin | |
parent | 12cefbcc20c8a4c7a1ae2871cb85a3fb050c4c19 (diff) | |
download | src-e0908a9f34dfc9835f1cb5dad1cf2c4cc6466591.tar.gz src-e0908a9f34dfc9835f1cb5dad1cf2c4cc6466591.zip |
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
Notes
Notes:
svn path=/head/; revision=57034
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_install/lib/file.c | 2 |
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 bc717f9f018a..b25dc9ec7dc8 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; |