diff options
author | Serge E. Hallyn <serue@us.ibm.com> | 2006-10-02 05:18:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-02 10:57:21 -0400 |
commit | e9ff3990f08e9a0c2839cc22808b01732ea5b3e4 (patch) | |
tree | c638a7b89f0c5e8adc410316d06ca1de8b8dabee /arch/x86_64 | |
parent | 0bdd7aab7f0ecd5d337910816aa058c18398628e (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 'arch/x86_64')
-rw-r--r-- | arch/x86_64/ia32/sys_ia32.c | 38 | ||||
-rw-r--r-- | arch/x86_64/kernel/sys_x86_64.c | 2 |
2 files changed, 20 insertions, 20 deletions
diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c index f280d3665f4b..26a01717cc1a 100644 --- a/arch/x86_64/ia32/sys_ia32.c +++ b/arch/x86_64/ia32/sys_ia32.c | |||
@@ -784,36 +784,36 @@ asmlinkage long sys32_olduname(struct oldold_utsname __user * name) | |||
784 | 784 | ||
785 | if (!name) | 785 | if (!name) |
786 | return -EFAULT; | 786 | return -EFAULT; |
787 | if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname))) | 787 | if (!access_ok(VERIFY_WRITE, name, sizeof(struct oldold_utsname))) |
788 | return -EFAULT; | 788 | return -EFAULT; |
789 | 789 | ||
790 | down_read(&uts_sem); | 790 | down_read(&uts_sem); |
791 | 791 | ||
792 | err = __copy_to_user(&name->sysname,&system_utsname.sysname, | 792 | err = __copy_to_user(&name->sysname,&utsname()->sysname, |
793 | __OLD_UTS_LEN); | 793 | __OLD_UTS_LEN); |
794 | err |= __put_user(0,name->sysname+__OLD_UTS_LEN); | 794 | err |= __put_user(0,name->sysname+__OLD_UTS_LEN); |
795 | err |= __copy_to_user(&name->nodename,&system_utsname.nodename, | 795 | err |= __copy_to_user(&name->nodename,&utsname()->nodename, |
796 | __OLD_UTS_LEN); | 796 | __OLD_UTS_LEN); |
797 | err |= __put_user(0,name->nodename+__OLD_UTS_LEN); | 797 | err |= __put_user(0,name->nodename+__OLD_UTS_LEN); |
798 | err |= __copy_to_user(&name->release,&system_utsname.release, | 798 | err |= __copy_to_user(&name->release,&utsname()->release, |
799 | __OLD_UTS_LEN); | 799 | __OLD_UTS_LEN); |
800 | err |= __put_user(0,name->release+__OLD_UTS_LEN); | 800 | err |= __put_user(0,name->release+__OLD_UTS_LEN); |
801 | err |= __copy_to_user(&name->version,&system_utsname.version, | 801 | err |= __copy_to_user(&name->version,&utsname()->version, |
802 | __OLD_UTS_LEN); | 802 | __OLD_UTS_LEN); |
803 | err |= __put_user(0,name->version+__OLD_UTS_LEN); | 803 | err |= __put_user(0,name->version+__OLD_UTS_LEN); |
804 | { | 804 | { |
805 | char *arch = "x86_64"; | 805 | char *arch = "x86_64"; |
806 | if (personality(current->personality) == PER_LINUX32) | 806 | if (personality(current->personality) == PER_LINUX32) |
807 | arch = "i686"; | 807 | arch = "i686"; |
808 | 808 | ||
809 | err |= __copy_to_user(&name->machine,arch,strlen(arch)+1); | 809 | err |= __copy_to_user(&name->machine, arch, strlen(arch)+1); |
810 | } | 810 | } |
811 | 811 | ||
812 | up_read(&uts_sem); | 812 | up_read(&uts_sem); |
813 | 813 | ||
814 | err = err ? -EFAULT : 0; | 814 | err = err ? -EFAULT : 0; |
815 | 815 | ||
816 | return err; | 816 | return err; |
817 | } | 817 | } |
818 | 818 | ||
819 | long sys32_uname(struct old_utsname __user * name) | 819 | long sys32_uname(struct old_utsname __user * name) |
@@ -822,7 +822,7 @@ long sys32_uname(struct old_utsname __user * name) | |||
822 | if (!name) | 822 | if (!name) |
823 | return -EFAULT; | 823 | return -EFAULT; |
824 | down_read(&uts_sem); | 824 | down_read(&uts_sem); |
825 | err=copy_to_user(name, &system_utsname, sizeof (*name)); | 825 | err = copy_to_user(name, utsname(), sizeof (*name)); |
826 | up_read(&uts_sem); | 826 | up_read(&uts_sem); |
827 | if (personality(current->personality) == PER_LINUX32) | 827 | if (personality(current->personality) == PER_LINUX32) |
828 | err |= copy_to_user(&name->machine, "i686", 5); | 828 | err |= copy_to_user(&name->machine, "i686", 5); |
diff --git a/arch/x86_64/kernel/sys_x86_64.c b/arch/x86_64/kernel/sys_x86_64.c index 6449ea8fe756..76bf7c241fe4 100644 --- a/arch/x86_64/kernel/sys_x86_64.c +++ b/arch/x86_64/kernel/sys_x86_64.c | |||
@@ -148,7 +148,7 @@ asmlinkage long sys_uname(struct new_utsname __user * name) | |||
148 | { | 148 | { |
149 | int err; | 149 | int err; |
150 | down_read(&uts_sem); | 150 | down_read(&uts_sem); |
151 | err = copy_to_user(name, &system_utsname, sizeof (*name)); | 151 | err = copy_to_user(name, utsname(), sizeof (*name)); |
152 | up_read(&uts_sem); | 152 | up_read(&uts_sem); |
153 | if (personality(current->personality) == PER_LINUX32) | 153 | if (personality(current->personality) == PER_LINUX32) |
154 | err |= copy_to_user(&name->machine, "i686", 5); | 154 | err |= copy_to_user(&name->machine, "i686", 5); |