From root@ws.urai.ru  Mon Sep  9 00:42:26 2002
Return-Path: <root@ws.urai.ru>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8E7B837B400
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  9 Sep 2002 00:42:26 -0700 (PDT)
Received: from ws.urai.ru (ws.urai.ru [212.76.171.29])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C9C4443E42
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  9 Sep 2002 00:42:24 -0700 (PDT)
	(envelope-from root@ws.urai.ru)
Received: from ws.urai.ru (localhost [127.0.0.1])
	by ws.urai.ru (8.12.6/8.12.6) with ESMTP id g897gCoa002424
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 9 Sep 2002 13:42:12 +0600 (YEKST)
	(envelope-from root@ws.urai.ru)
Received: (from root@localhost)
	by ws.urai.ru (8.12.6/8.12.6/Submit) id g897gC8m002423;
	Mon, 9 Sep 2002 13:42:12 +0600 (YEKST)
Message-Id: <200209090742.g897gC8m002423@ws.urai.ru>
Date: Mon, 9 Sep 2002 13:42:12 +0600 (YEKST)
From: Belousov Oleg <oleg@belousov.com>
Reply-To: Belousov Oleg <oleg@belousov.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: IPFW2 with UID/GID options problem
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         42579
>Category:       bin
>Synopsis:       IPFW2 with UID/GID options problem
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    maxim
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 09 00:50:03 PDT 2002
>Closed-Date:    Mon Nov 18 14:50:31 PST 2002
>Last-Modified:  Mon Nov 18 14:50:31 PST 2002
>Originator:     Belousov Oleg
>Release:        FreeBSD 4.7-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD ws 4.7-PRERELEASE FreeBSD 4.7-PRERELEASE #0: Mon Sep 9 09:26:22 YEKST 2002 root@ws:/usr/src/sys/compile/WS i386


	
>Description:
	ipfw add ... uid 1000 gid 1002 - work ok
	ipfw add ... uid user gid group - don't work! User always root, group
allways wheel

>How-To-Repeat:
	Always
>Fix:

--- ipfw2.c.old	Mon Sep  9 13:05:59 2002
+++ ipfw2.c	Mon Sep  9 13:10:52 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++;
 		    }


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->luigi 
Responsible-Changed-By: johan 
Responsible-Changed-When: Fri Oct 25 02:24:23 PDT 2002 
Responsible-Changed-Why:  
Over to ipfw maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42579 
State-Changed-From-To: open->patched 
State-Changed-By: maxim 
State-Changed-When: Wed Nov 6 07:02:34 PST 2002 
State-Changed-Why:  
Fixed in rev. 1.15 src/sbin/ipfw/ipfw2.c in -CURRENT. Thanks! 


Responsible-Changed-From-To: luigi->maxim 
Responsible-Changed-By: maxim 
Responsible-Changed-When: Wed Nov 6 07:02:34 PST 2002 
Responsible-Changed-Why:  
Will MFC the fix in two weeks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42579 
State-Changed-From-To: patched->closed 
State-Changed-By: luigi 
State-Changed-When: Mon Nov 18 14:50:07 PST 2002 
State-Changed-Why:  
patch merged to -stable 


http://www.freebsd.org/cgi/query-pr.cgi?pr=42579 
>Unformatted:
