chiark / gitweb /
split selinux label operations out of cgroup-util, socket-util
[elogind.git] / src / nspawn.c
index b548b126c6e5dccae2a71abcfdc07a5659d64135..9e21c5e8b567340bd31f2d0f3cb0f8a1b697e6de 100644 (file)
@@ -43,6 +43,8 @@
 
 #include "log.h"
 #include "util.h"
+#include "mkdir.h"
+#include "audit.h"
 #include "missing.h"
 #include "cgroup-util.h"
 #include "strv.h"
@@ -197,7 +199,7 @@ static int mount_all(const char *dest) {
         }
 
         /* Fix the timezone, if possible */
-        if (asprintf(&where, "%s/%s", dest, "/etc/localtime") >= 0) {
+        if (asprintf(&where, "%s/etc/localtime", dest) >= 0) {
 
                 if (mount("/etc/localtime", where, "bind", MS_BIND, NULL) >= 0)
                         mount("/etc/localtime", where, "bind", MS_BIND|MS_REMOUNT|MS_RDONLY, NULL);
@@ -205,6 +207,14 @@ static int mount_all(const char *dest) {
                 free(where);
         }
 
+        if (asprintf(&where, "%s/etc/timezone", dest) >= 0) {
+
+                if (mount("/etc/timezone", where, "bind", MS_BIND, NULL) >= 0)
+                        mount("/etc/timezone", where, "bind", MS_BIND|MS_REMOUNT|MS_RDONLY, NULL);
+
+                free(where);
+        }
+
         return r;
 }