Skip to content

Commit

Permalink
Isolate the UTS namespace's domainname and hostname back
Browse files Browse the repository at this point in the history
Commit 7d69a1f ("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>
  • Loading branch information
Pavel Emelyanov authored and Linus Torvalds committed Nov 29, 2007
1 parent 48986f0 commit 32df81c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/utsname_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 32df81c

Please sign in to comment.