From 3d22bc8636b05524a12255781bed6ef5c6afac9d Mon Sep 17 00:00:00 2001 From: Lukasz Rubaszewski Date: Fri, 24 Nov 2017 22:28:14 +0100 Subject: [PATCH] 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. --- src/tmpfiles/tmpfiles.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 1af4b6d4cb..970ea3b05f 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -1095,7 +1095,7 @@ static int item_do_children(Item *i, const char *path, action_t action) { d = opendir_nomod(path); 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) { _cleanup_free_ char *p = NULL; -- 2.25.1