summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-03-15 00:45:02 +0100
committerLennart Poettering <lennart@poettering.net>2012-03-15 00:45:02 +0100
commit4d1c38b8072dca18807371170d5e14fa8dc0baa5 (patch)
tree98effe44075ad52b97434f6b1e1066f71d7323ed /src
parent6bc1ce40e531257ae8dd9bbbbcb48e5de0a1187b (diff)
nspawn: mount /etc/timezone into nspawn environment too
Diffstat (limited to 'src')
-rw-r--r--src/nspawn.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/nspawn.c b/src/nspawn.c
index b548b126c6..6f5a9d9547 100644
--- a/src/nspawn.c
+++ b/src/nspawn.c
@@ -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;
}