mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 17:51:22 +03:00
tmpfiles: check if not too many symbolic links. (#7423)
Some filesystems do not set d_type value when readdir is called, so entry type is unknown. Therefore check if accessing entry does not return ELOOP error.
This commit is contained in:
parent
1ff654e28b
commit
3d22bc8636
@ -1095,7 +1095,7 @@ static int item_do_children(Item *i, const char *path, action_t action) {
|
|||||||
|
|
||||||
d = opendir_nomod(path);
|
d = opendir_nomod(path);
|
||||||
if (!d)
|
if (!d)
|
||||||
return IN_SET(errno, ENOENT, ENOTDIR) ? 0 : -errno;
|
return IN_SET(errno, ENOENT, ENOTDIR, ELOOP) ? 0 : -errno;
|
||||||
|
|
||||||
FOREACH_DIRENT_ALL(de, d, r = -errno) {
|
FOREACH_DIRENT_ALL(de, d, r = -errno) {
|
||||||
_cleanup_free_ char *p = NULL;
|
_cleanup_free_ char *p = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user