chiark / gitweb /
tmpfiles: ensure we do no follow symlinks when cleaning up dirs
[elogind.git] / src / tmpfiles.c
index 120236c5cc07490f03724b694e77e831f9987f92..1234cbf3480c9c1bc190dfdfe3c3a768cba0e66f 100644 (file)
@@ -149,7 +149,7 @@ static int dir_cleanup(
                                 DIR *sub_dir;
                                 int q;
 
-                                sub_dir = xopendirat(dirfd(d), dent->d_name);
+                                sub_dir = xopendirat(dirfd(d), dent->d_name, O_NOFOLLOW);
                                 if (sub_dir == NULL) {
                                         if (errno != ENOENT) {
                                                 log_error("opendir(%s/%s) failed: %m", p, dent->d_name);