aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
authorSerge E. Hallyn <serue@us.ibm.com>2006-10-02 05:18:11 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-02 10:57:21 -0400
commite9ff3990f08e9a0c2839cc22808b01732ea5b3e4 (patch)
treec638a7b89f0c5e8adc410316d06ca1de8b8dabee /kernel/sys.c
parent0bdd7aab7f0ecd5d337910816aa058c18398628e (diff)
[PATCH] namespaces: utsname: switch to using uts namespaces
Replace references to system_utsname to the per-process uts namespace where appropriate. This includes things like uname. Changes: Per Eric Biederman's comments, use the per-process uts namespace for ELF_PLATFORM, sunrpc, and parts of net/ipv4/ipconfig.c [jdike@addtoit.com: UML fix] [clg@fr.ibm.com: cleanup] [akpm@osdl.org: build fix] Signed-off-by: Serge E. Hallyn <serue@us.ibm.com> Cc: Kirill Korotaev <dev@openvz.org> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Herbert Poetzl <herbert@13thfloor.at> Cc: Andrey Savochkin <saw@sw.ru> Signed-off-by: Cedric Le Goater <clg@fr.ibm.com> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 398d57923f95..3a4776e8f16e 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1655,7 +1655,7 @@ asmlinkage long sys_newuname(struct new_utsname __user * name)
1655 int errno = 0; 1655 int errno = 0;
1656 1656
1657 down_read(&uts_sem); 1657 down_read(&uts_sem);
1658 if (copy_to_user(name,&system_utsname,sizeof *name)) 1658 if (copy_to_user(name, utsname(), sizeof *name))
1659 errno = -EFAULT; 1659 errno = -EFAULT;
1660 up_read(&uts_sem); 1660 up_read(&uts_sem);
1661 return errno; 1661 return errno;
@@ -1673,8 +1673,8 @@ asmlinkage long sys_sethostname(char __user *name, int len)
1673 down_write(&uts_sem); 1673 down_write(&uts_sem);
1674 errno = -EFAULT; 1674 errno = -EFAULT;
1675 if (!copy_from_user(tmp, name, len)) { 1675 if (!copy_from_user(tmp, name, len)) {
1676 memcpy(system_utsname.nodename, tmp, len); 1676 memcpy(utsname()->nodename, tmp, len);
1677 system_utsname.nodename[len] = 0; 1677 utsname()->nodename[len] = 0;
1678 errno = 0; 1678 errno = 0;
1679 } 1679 }
1680 up_write(&uts_sem); 1680 up_write(&uts_sem);
@@ -1690,11 +1690,11 @@ asmlinkage long sys_gethostname(char __user *name, int len)
1690 if (len < 0) 1690 if (len < 0)
1691 return -EINVAL; 1691 return -EINVAL;
1692 down_read(&uts_sem); 1692 down_read(&uts_sem);
1693 i = 1 + strlen(system_utsname.nodename); 1693 i = 1 + strlen(utsname()->nodename);
1694 if (i > len) 1694 if (i > len)
1695 i = len; 1695 i = len;
1696 errno = 0; 1696 errno = 0;
1697 if (copy_to_user(name, system_utsname.nodename, i)) 1697 if (copy_to_user(name, utsname()->nodename, i))
1698 errno = -EFAULT; 1698 errno = -EFAULT;
1699 up_read(&uts_sem); 1699 up_read(&uts_sem);
1700 return errno; 1700 return errno;
@@ -1719,8 +1719,8 @@ asmlinkage long sys_setdomainname(char __user *name, int len)
1719 down_write(&uts_sem); 1719 down_write(&uts_sem);
1720 errno = -EFAULT; 1720 errno = -EFAULT;
1721 if (!copy_from_user(tmp, name, len)) { 1721 if (!copy_from_user(tmp, name, len)) {
1722 memcpy(system_utsname.domainname, tmp, len); 1722 memcpy(utsname()->domainname, tmp, len);
1723 system_utsname.domainname[len] = 0; 1723 utsname()->domainname[len] = 0;
1724 errno = 0; 1724 errno = 0;
1725 } 1725 }
1726 up_write(&uts_sem); 1726 up_write(&uts_sem);