summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-03-16 03:27:02 +0100
committerLennart Poettering <lennart@poettering.net>2011-03-16 03:27:02 +0100
commit715ac17a84f7d721dec613d86d83e671704fafcc (patch)
tree65759e9c9f813f7d58394faa13555d6fb51f2548
parentfd14078a3ab2110cd10e5eb55cdaeecfa51a189c (diff)
nspawn: bind mount /etc/localtime
-rw-r--r--src/nspawn.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nspawn.c b/src/nspawn.c
index cd528deb79..aaa5d1f9d0 100644
--- a/src/nspawn.c
+++ b/src/nspawn.c
@@ -125,9 +125,9 @@ static int mount_all(const char *dest) {
unsigned k;
int r = 0;
+ char *where;
for (k = 0; k < ELEMENTSOF(mount_table); k++) {
- char *where;
int t;
if (asprintf(&where, "%s/%s", dest, mount_table[k].where) < 0) {
@@ -167,6 +167,13 @@ static int mount_all(const char *dest) {
free(where);
}
+ /* Fix the timezone, if possible */
+ if (asprintf(&where, "%s/%s", dest, "/etc/localtime") >= 0) {
+ mount("/etc/localtime", where, "bind", MS_BIND, NULL);
+ mount("/etc/localtime", where, "bind", MS_BIND|MS_REMOUNT|MS_RDONLY, NULL);
+ free(where);
+ }
+
return r;
}