mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04: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
1 changed files with 1 additions and 1 deletions
|
|
@ -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 a new issue