mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-29 12:44:53 +01:00
pathconf() and acl_get_file() follow links so they cannot be used to
determine whether a symlink has an ACL. Instead, assume that symbolic links don't have ACLs and don't bother checking. Avoids spurious ENOENT warnings when listing directories containing broken symlinks on filesystems with ACLs enabled. Pointed out by: rwatson, bde
This commit is contained in:
parent
71ffa67746
commit
3fceb9fd5b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=108066
@ -674,6 +674,14 @@ aclmode(char *buf, FTSENT *p, int *haveacls)
|
||||
else
|
||||
snprintf(name, sizeof(name), "%s/%s",
|
||||
p->fts_parent->fts_accpath, p->fts_name);
|
||||
/*
|
||||
* We have no way to tell whether a symbolic link has an ACL since
|
||||
* pathconf() and acl_get_file() both follow them.
|
||||
*/
|
||||
if (S_ISLNK(p->fts_statp->st_mode)) {
|
||||
*haveacls = 1;
|
||||
return;
|
||||
}
|
||||
if ((ret = pathconf(name, _PC_ACL_EXTENDED)) <= 0) {
|
||||
if (ret < 0 && errno != EINVAL)
|
||||
warn("%s", name);
|
||||
|
Loading…
Reference in New Issue
Block a user