mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-18 15:30:21 +00:00
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
This commit is contained in:
parent
12cefbcc20
commit
e0908a9f34
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=57034
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user