Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Oct 2002 14:26:17 +0600
From:      Alexey Dokuchaev <danfe@regency.nsu.ru>
To:        ipfw@freebsd.org
Subject:   Typo in uid/gid handling in ipfw2
Message-ID:  <20021029082617.GA24516@regency.nsu.ru>

next in thread | raw e-mail | index | archive | help

--cWoXeonUoKmBZSoM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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.

Thank you.

./danfe

--cWoXeonUoKmBZSoM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="ipfw2.diff"

--- 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++;
 		    }

--cWoXeonUoKmBZSoM--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ipfw" in the body of the message




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