Module Name: src Committed By: snj Date: Sat Aug 19 05:04:00 UTC 2017
Modified Files: src/sys/compat/linux/common [netbsd-6]: linux_time.c Log Message: Pull up following revision(s) (requested by mrg in ticket #1489): sys/compat/linux/common/linux_time.c: 1.38-1.39 via patch 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. -- Put suser check in the right function: settimeofday, not gettimeofday. While here, remove wrong comment. Noted by kre@. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.35.6.1 src/sys/compat/linux/common/linux_time.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/compat/linux/common/linux_time.c diff -u src/sys/compat/linux/common/linux_time.c:1.35 src/sys/compat/linux/common/linux_time.c:1.35.6.1 --- src/sys/compat/linux/common/linux_time.c:1.35 Fri Nov 18 04:07:44 2011 +++ src/sys/compat/linux/common/linux_time.c Sat Aug 19 05:03:59 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_time.c,v 1.35 2011/11/18 04:07:44 christos Exp $ */ +/* $NetBSD: linux_time.c,v 1.35.6.1 2017/08/19 05:03:59 snj 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.35 2011/11/18 04:07:44 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.35.6.1 2017/08/19 05:03:59 snj Exp $"); #include <sys/param.h> #include <sys/ucred.h> @@ -109,11 +109,10 @@ linux_sys_settimeofday(struct lwp *l, co return (error); } - /* - * If user is not the superuser, we returned - * after the sys_settimeofday() call. - */ if (SCARG(uap, tzp)) { + if (kauth_authorize_generic(kauth_cred_get(), + KAUTH_GENERIC_ISSUSER, NULL) != 0) + return (EPERM); error = copyin(SCARG(uap, tzp), &linux_sys_tz, sizeof(linux_sys_tz)); if (error) return (error);