Isolate the UTS namespace's domainname and hostname back
PATCH 1/1 Isolate the UTS namespace's domainname and hostname back
The commit
commit 7d69a1f4a72b18876c99c697692b78339d491568
Author: Cedric Le Goater <[email protected]> Date: Sun Jul 15 23:40:58 2007 -0700
remove CONFIG_UTS_NS and CONFIG_IPC_NS
accidentally removed the code, that prevented the uts->hostname and uts->domainname values from being overwritten from another namespace. In other words, setting hostname/domainname via sysfs (echo xxx > /proc/sys/kernel/(host|domain)name) cased the new value to be set in init UTS namespace only.
Return the isolation back.
---
kernel/utsname_sysctl.c +4 -0
@@ -18,6 +18,10 @@static void *get_uts (ctl_table *table,int write) {char *which = table->data; +struct uts_namespace *uts_ns; + + uts_ns = current->nsproxy->uts_ns; + which = (which - (char *)&init_uts_ns) + (char *)uts_ns;if (!write)down_read (&uts_sem);
Quoted 8 lines · Pavel Emelyanov
The commit
commit
7d69a1f4a72b18876c99c697692b78339d491568Author: Cedric Le Goater <[email protected]> Date: Sun Jul 15 23:40:58 2007 -0700remove
CONFIG_UTS_NSandCONFIG_IPC_NS
Quoted 7 lines
accidentally removed the code, that prevented the
uts->hostnameanduts->domainnamevalues from being overwritten from another namespace. In other words, setting hostname/domainname via sysfs (echo xxx > /proc/sys/kernel/(host|domain)name) cased the new value to be set in init UTS namespace only.Return the isolation back.
yep. sorry about that. I was going to send the same patch in a minute.
Quoted 1 line
Signed-off-by Pavel Emelyanov <[email protected]>
Thanks,
C.