chiark / gitweb /
nspawn: bind mount /dev/nul to /proc/kmsg, so that the container can't muck with...
[elogind.git] / src / tmpfiles.c
index f3c38a84339229c48eb68c61891934c0518283db..15913089ba44c576c6aec8f14da4b04c1b7a8bf7 100644 (file)
@@ -6,16 +6,16 @@
   Copyright 2010 Lennart Poettering, Kay Sievers
 
   systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 2 of the License, or
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
   (at your option) any later version.
 
   systemd is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  General Public License for more details.
+  Lesser General Public License for more details.
 
-  You should have received a copy of the GNU General Public License
+  You should have received a copy of the GNU Lesser General Public License
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
@@ -41,6 +41,7 @@
 
 #include "log.h"
 #include "util.h"
+#include "mkdir.h"
 #include "strv.h"
 #include "label.h"
 #include "set.h"
@@ -268,7 +269,7 @@ static int dir_cleanup(
                                 DIR *sub_dir;
                                 int q;
 
-                                sub_dir = xopendirat(dirfd(d), dent->d_name, O_NOFOLLOW);
+                                sub_dir = xopendirat(dirfd(d), dent->d_name, O_NOFOLLOW|O_NOATIME);
                                 if (sub_dir == NULL) {
                                         if (errno != ENOENT) {
                                                 log_error("opendir(%s/%s) failed: %m", p, dent->d_name);
@@ -893,7 +894,7 @@ static bool item_equal(Item *a, Item *b) {
              a->type == TRUNCATE_FILE ||
              a->type == WRITE_FILE ||
              a->type == CREATE_SYMLINK) &&
-            !streq(a->argument, b->argument))
+            !streq_ptr(a->argument, b->argument))
                 return false;
 
         if ((a->type == CREATE_CHAR_DEVICE ||
@@ -1271,8 +1272,8 @@ int main(int argc, char *argv[]) {
                 char **files, **f;
 
                 r = conf_files_list(&files, ".conf",
-                                    "/run/tmpfiles.d",
                                     "/etc/tmpfiles.d",
+                                    "/run/tmpfiles.d",
                                     "/usr/local/lib/tmpfiles.d",
                                     "/usr/lib/tmpfiles.d",
                                     NULL);