diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-10-27 04:51:38 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-10-27 04:51:38 +0000 |
commit | 06374b12d7101b3b6f600db44a41fabbf0177322 (patch) | |
tree | a4063593fd6efb98597c447ddfffa625f3b40532 | |
parent | 9b0887e3b5e15a63c81a857533d01bdab8ffc899 (diff) |
Allow set[gu]id() if the [gu]id we are trying to set is the saved [gu]id,
but only set effective [gu]id.
-rw-r--r-- | sys/kern/kern_prot.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 1f21a6d3531..ab4ae7b90ec 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_prot.c,v 1.6 1996/10/26 07:29:40 tholo Exp $ */ +/* $OpenBSD: kern_prot.c,v 1.7 1996/10/27 04:51:37 tholo Exp $ */ /* $NetBSD: kern_prot.c,v 1.33 1996/02/09 18:59:42 christos Exp $ */ /* @@ -290,6 +290,7 @@ sys_setuid(p, v, retval) uid = SCARG(uap, uid); #endif if (uid != pc->p_ruid && + uid != pc->p_svuid && uid != pc->pc_ucred->cr_uid && (error = suser(pc->pc_ucred, &p->p_acflag))) return (error); @@ -369,6 +370,7 @@ sys_setgid(p, v, retval) gid = SCARG(uap, gid); #endif if (gid != pc->p_rgid && + gid != pc->p_svgid && gid != pc->pc_ucred->cr_gid && (error = suser(pc->pc_ucred, &p->p_acflag))) return (error); |