diff options
Diffstat (limited to 'arch/mips/kernel/sysmips.c')
-rw-r--r-- | arch/mips/kernel/sysmips.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/mips/kernel/sysmips.c b/arch/mips/kernel/sysmips.c index ae99466e4..e73598345 100644 --- a/arch/mips/kernel/sysmips.c +++ b/arch/mips/kernel/sysmips.c @@ -7,7 +7,7 @@ * * Copyright (C) 1995, 1996, 1997 by Ralf Baechle * - * $Id: sysmips.c,v 1.2 1997/06/28 23:26:25 ralf Exp $ + * $Id: sysmips.c,v 1.2 1997/07/01 08:59:08 ralf Exp $ */ #include <linux/errno.h> #include <linux/linkage.h> @@ -57,18 +57,21 @@ sys_sysmips(int cmd, int arg1, int arg2, int arg3) switch(cmd) { case SETNAME: - if (!suser()) { - retval = -EPERM; + retval = -EPERM; + if (!suser()) goto out; - } + name = (char *) arg1; len = strlen_user(name); + + retval = len; if (len < 0) - retval = len; goto out; + + retval = -EINVAL; if (len == 0 || len > __NEW_UTS_LEN) - retval = -EINVAL; goto out; + copy_from_user(system_utsname.nodename, name, len); system_utsname.nodename[len] = '\0'; retval = 0; |