]> err.no Git - systemd/commitdiff
nspawn: mount /etc/timezone into nspawn environment too
authorLennart Poettering <lennart@poettering.net>
Wed, 14 Mar 2012 23:45:02 +0000 (00:45 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 14 Mar 2012 23:45:02 +0000 (00:45 +0100)
src/nspawn.c

index b548b126c6e5dccae2a71abcfdc07a5659d64135..6f5a9d9547d52931fcd5d5d68aac244e6214c1c4 100644 (file)
@@ -197,7 +197,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 +205,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;
 }