Simplify previous: the original code was mostly correct but relied on
"register_t" being signed.
This commit is contained in:
parent
eafacad922
commit
00d08a9058
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kern_prot.c,v 1.112 2011/04/26 19:58:12 martin Exp $ */
|
||||
/* $NetBSD: kern_prot.c,v 1.113 2011/04/27 06:22:11 martin Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989, 1990, 1991, 1993
|
||||
|
@ -41,7 +41,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_prot.c,v 1.112 2011/04/26 19:58:12 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_prot.c,v 1.113 2011/04/27 06:22:11 martin Exp $");
|
||||
|
||||
#include "opt_compat_43.h"
|
||||
|
||||
|
@ -231,9 +231,7 @@ sys_getgroups(struct lwp *l, const struct sys_getgroups_args *uap, register_t *r
|
|||
*retval = kauth_cred_ngroups(l->l_cred);
|
||||
if (SCARG(uap, gidsetsize) == 0)
|
||||
return 0;
|
||||
if (SCARG(uap, gidsetsize) < 0)
|
||||
return EINVAL;
|
||||
if (SCARG(uap, gidsetsize) < *retval)
|
||||
if (SCARG(uap, gidsetsize) < (int)*retval)
|
||||
return EINVAL;
|
||||
|
||||
return kauth_cred_getgroups(l->l_cred, SCARG(uap, gidset), *retval,
|
||||
|
|
Loading…
Reference in New Issue