aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-11-28 19:21:38 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-29 12:24:53 -0500
commit32df81cbd5b41d281cc3d7e7ff6a98ac6201e197 (patch)
tree61fa5ac58e6b74a571ed2ac605454218bd0c75c6
parent48986f06b6bc6f435debcfad0a748ce35f0a52df (diff)
Isolate the UTS namespace's domainname and hostname back
Commit 7d69a1f4a72b18876c99c697692b78339d491568 ("remove CONFIG_UTS_NS and CONFIG_IPC_NS") by Cedric Le Goater 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. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Cedric Le Goater <clg@fr.ibm.com> Acked-by: Serge Hallyn <serue@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--kernel/utsname_sysctl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/utsname_sysctl.c b/kernel/utsname_sysctl.c
index c76c06466bfd..fe3a56c2256d 100644
--- a/kernel/utsname_sysctl.c
+++ b/kernel/utsname_sysctl.c
@@ -18,6 +18,10 @@
18static void *get_uts(ctl_table *table, int write) 18static void *get_uts(ctl_table *table, int write)
19{ 19{
20 char *which = table->data; 20 char *which = table->data;
21 struct uts_namespace *uts_ns;
22
23 uts_ns = current->nsproxy->uts_ns;
24 which = (which - (char *)&init_uts_ns) + (char *)uts_ns;
21 25
22 if (!write) 26 if (!write)
23 down_read(&uts_sem); 27 down_read(&uts_sem);