Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/linux/common Only let the superuser set the compa...



details:   https://anonhg.NetBSD.org/src/rev/823f343ca3dd
branches:  trunk
changeset: 825729:823f343ca3dd
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Jul 29 01:14:59 2017 +0000

description:
Only let the superuser set the compat_linux timezone.

Not really keen to invent a new kauth cookie for this useless purpose.

>From Ilja Van Sprundel.

diffstat:

 sys/compat/linux/common/linux_time.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r a7ae9ad88524 -r 823f343ca3dd sys/compat/linux/common/linux_time.c
--- a/sys/compat/linux/common/linux_time.c      Sat Jul 29 01:14:00 2017 +0000
+++ b/sys/compat/linux/common/linux_time.c      Sat Jul 29 01:14:59 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_time.c,v 1.37 2014/01/13 10:33:03 njoly Exp $ */
+/*     $NetBSD: linux_time.c,v 1.38 2017/07/29 01:14:59 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.37 2014/01/13 10:33:03 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.38 2017/07/29 01:14:59 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/ucred.h>
@@ -79,6 +79,9 @@
        }
 
        if (SCARG(uap, tzp)) {
+               if (kauth_authorize_generic(kauth_cred_get(),
+                       KAUTH_GENERIC_ISSUSER, NULL) != 0)
+                       return (EPERM);
                error = copyout(&linux_sys_tz, SCARG(uap, tzp), sizeof(linux_sys_tz));
                if (error)
                        return (error);



Home | Main Index | Thread Index | Old Index