Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Apr 1995 11:30:42 +0900
From:      NIIMI Satoshi <sa2c@and.or.jp>
To:        "Andrey A. Chernov, Black Mage" <ache@astral.msk.su>
Cc:        security@FreeBSD.org
Subject:   Re: Call for remove setr[ug]id() and setre[ug]id() from libc
Message-ID:  <199504290230.LAA05883@us.and.or.jp>
In-Reply-To: "Andrey A. Chernov, Black Mage"'s message of Fri, 28 Apr 1995 19:39:43 %2B0400

next in thread | raw e-mail | index | archive | help
> So, I do it. Now it is impossible to unify rule: it divides
> to POSIX and non-POSIX behaviour.

Hmm...  I've tried to hack set[ug]id() to check saved id like
setre[ug]id().  Does this hack violate POSIX standard?

--- kern_prot.c.orig	Sat Apr 29 11:18:29 1995
+++ kern_prot.c	Sat Apr 29 11:21:15 1995
@@ -262,6 +262,7 @@ setuid(p, uap, retval)
 
 	uid = uap->uid;
 	if (uid != pc->p_ruid &&
+	    uid != pc->p_svuid &&
 	    (error = suser(pc->pc_ucred, &p->p_acflag)))
 		return (error);
 	/*
@@ -322,7 +323,9 @@ setgid(p, uap, retval)
 	int error;
 
 	gid = uap->gid;
-	if (gid != pc->p_rgid && (error = suser(pc->pc_ucred, &p->p_acflag)))
+	if (gid != pc->p_rgid &&
+	    gid != pc->p_svgid &&
+	    (error = suser(pc->pc_ucred, &p->p_acflag)))
 		return (error);
 	pc->pc_ucred = crcopy(pc->pc_ucred);
 	pc->pc_ucred->cr_groups[0] = gid;
--
NIIMI Satoshi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199504290230.LAA05883>