nspawn: mount /etc/timezone into nspawn environment too

This commit is contained in:
Lennart Poettering
2012-03-15 00:45:02 +01:00
parent 6bc1ce40e5
commit 4d1c38b807
+9 -1
View 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;
}