From owner-freebsd-ipfw Tue Oct 29 0:35:36 2002 Delivered-To: freebsd-ipfw@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B0E4137B401 for ; Tue, 29 Oct 2002 00:35:34 -0800 (PST) Received: from carp.icir.org (carp.icir.org [192.150.187.71]) by mx1.FreeBSD.org (Postfix) with ESMTP id 63B6443E77 for ; Tue, 29 Oct 2002 00:35:34 -0800 (PST) (envelope-from rizzo@carp.icir.org) Received: from carp.icir.org (localhost [127.0.0.1]) by carp.icir.org (8.12.3/8.12.3) with ESMTP id g9T8ZRpJ007491; Tue, 29 Oct 2002 00:35:27 -0800 (PST) (envelope-from rizzo@carp.icir.org) Received: (from rizzo@localhost) by carp.icir.org (8.12.3/8.12.3/Submit) id g9T8ZRUj007490; Tue, 29 Oct 2002 00:35:27 -0800 (PST) (envelope-from rizzo) Date: Tue, 29 Oct 2002 00:35:27 -0800 From: Luigi Rizzo To: Alexey Dokuchaev Cc: ipfw@FreeBSD.ORG Subject: Re: Typo in uid/gid handling in ipfw2 Message-ID: <20021029003527.A7265@carp.icir.org> References: <20021029082617.GA24516@regency.nsu.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20021029082617.GA24516@regency.nsu.ru>; from danfe@regency.nsu.ru on Tue, Oct 29, 2002 at 02:26:17PM +0600 Sender: owner-freebsd-ipfw@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, Oct 29, 2002 at 02:26:17PM +0600, Alexey Dokuchaev wrote: > Hello! > > Currently, both -STABLE and -CURRENT IPFW2 user-level code is broken WRT > uid/gid handling stuff. > > It looks more like a typo, but it is there. I've notified Luigi and > supplied a fix (attached). I am not sure if it is worth mentioning in > errata since IPFW2 is not enabled by default (and even hidden). > > It's probably worth considering for review and possible commit. definitely. if there are any takers... i believe you have tested the fix is working, right ? cheers luiig > Thank you. > > ./danfe > --- ipfw2.c.orig Tue Oct 29 10:19:15 2002 > +++ ipfw2.c Tue Oct 29 10:33:55 2002 > @@ -2937,7 +2937,7 @@ > pwd = (*end == '\0') ? getpwuid(uid) : getpwnam(*av); > if (pwd == NULL) > errx(EX_DATAERR, "uid \"%s\" nonexistent", *av); > - cmd32->d[0] = uid; > + cmd32->d[0] = pwd->pw_uid; > cmd->len = F_INSN_SIZE(ipfw_insn_u32); > ac--; av++; > } > @@ -2956,7 +2956,7 @@ > if (grp == NULL) > errx(EX_DATAERR, "gid \"%s\" nonexistent", *av); > > - cmd32->d[0] = gid; > + cmd32->d[0] = grp->gr_gid; > cmd->len = F_INSN_SIZE(ipfw_insn_u32); > ac--; av++; > } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ipfw" in the body of the message