From: Lennart Poettering Date: Wed, 16 Mar 2011 02:27:02 +0000 (+0100) Subject: nspawn: bind mount /etc/localtime X-Git-Tag: v21~68 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=715ac17a84f7d721dec613d86d83e671704fafcc;p=elogind.git nspawn: bind mount /etc/localtime --- diff --git a/src/nspawn.c b/src/nspawn.c index cd528deb7..aaa5d1f9d 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; }