Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Sep 2002 13:42:12 +0600 (YEKST)
From:      Belousov Oleg <oleg@belousov.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/42579: IPFW2 with UID/GID options problem
Message-ID:  <200209090742.g897gC8m002423@ws.urai.ru>

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

>Number:         42579
>Category:       bin
>Synopsis:       IPFW2 with UID/GID options problem
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 09 00:50:03 PDT 2002
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:

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




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