From: Lukasz Rubaszewski Date: Fri, 24 Nov 2017 21:28:14 +0000 (+0100) Subject: tmpfiles: check if not too many symbolic links. (#7423) X-Git-Tag: v236~119 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3d22bc8636b05524a12255781bed6ef5c6afac9d;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 1af4b6d4cbf..970ea3b05f8 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;