From owner-freebsd-ipfw Tue Oct 29 0:27:28 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 86F5E37B401 for ; Tue, 29 Oct 2002 00:27:26 -0800 (PST) Received: from mail.nsu.ru (mx.nsu.ru [193.124.215.71]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8819043E42 for ; Tue, 29 Oct 2002 00:27:25 -0800 (PST) (envelope-from danfe@regency.nsu.ru) Received: from drweb by mail.nsu.ru with drweb-scanned (Exim 3.20 #1) id 186RiB-00050B-00 for ipfw@freebsd.org; Tue, 29 Oct 2002 14:26:55 +0600 Received: from regency.nsu.ru ([193.124.210.26]) by mail.nsu.ru with esmtp (Exim 3.20 #1) id 186Rho-0004pG-00 for ipfw@freebsd.org; Tue, 29 Oct 2002 14:26:32 +0600 Received: from regency.nsu.ru (localhost [127.0.0.1]) by regency.nsu.ru (8.12.6/8.12.6) with ESMTP id g9T8QHiv045762 for ; Tue, 29 Oct 2002 14:26:22 +0600 (NOVT) (envelope-from danfe@regency.nsu.ru) Received: (from danfe@localhost) by regency.nsu.ru (8.12.6/8.12.6/Submit) id g9T8QHqZ045668 for ipfw@freebsd.org; Tue, 29 Oct 2002 14:26:17 +0600 (NOVT) Date: Tue, 29 Oct 2002 14:26:17 +0600 From: Alexey Dokuchaev To: ipfw@freebsd.org Subject: Typo in uid/gid handling in ipfw2 Message-ID: <20021029082617.GA24516@regency.nsu.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="cWoXeonUoKmBZSoM" Content-Disposition: inline User-Agent: Mutt/1.4i X-Envelope-To: ipfw@freebsd.org 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 --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