]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tmpfiles: check if not too many symbolic links. (#7423)
authorLukasz Rubaszewski <l_rubaszewski@o2.pl>
Fri, 24 Nov 2017 21:28:14 +0000 (22:28 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 24 Nov 2017 21:28:14 +0000 (22:28 +0100)
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

index 1af4b6d4cbfa0c3ea484bf86c85a9c9536df3674..970ea3b05f812cad4502e98f18e9c2b807bd8d43 100644 (file)
@@ -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;