X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fnspawn.c;h=6b0ba4e57f18e12234501ede131b1375c5a52fc6;hp=cd528deb79314e487c0d042a96000be02d952e6d;hb=7640a5de1b3ffe6547200ad204d14e4f067caf4f;hpb=fd14078a3ab2110cd10e5eb55cdaeecfa51a189c diff --git a/src/nspawn.c b/src/nspawn.c index cd528deb7..6b0ba4e57 100644 --- a/src/nspawn.c +++ b/src/nspawn.c @@ -117,7 +117,7 @@ static int mount_all(const char *dest) { { "sysfs", "/sys", "sysfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, true }, { "tmpfs", "/dev", "tmpfs", "mode=755", MS_NOSUID, true }, { "/dev/pts", "/dev/pts", "bind", NULL, MS_BIND, true }, - { "tmpfs", "/dev/.run", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV, true }, + { "tmpfs", "/run", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV, true }, #ifdef HAVE_SELINUX { "selinux", "/selinux", "selinuxfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, false }, #endif @@ -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; }