From owner-freebsd-bugs@FreeBSD.ORG Mon Mar 28 00:30:04 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 590EB16A4CE for ; Mon, 28 Mar 2005 00:30:04 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 01CE643D39 for ; Mon, 28 Mar 2005 00:30:04 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j2S0U3Lw083152 for ; Mon, 28 Mar 2005 00:30:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j2S0U3Lp083151; Mon, 28 Mar 2005 00:30:03 GMT (envelope-from gnats) Resent-Date: Mon, 28 Mar 2005 00:30:03 GMT Resent-Message-Id: <200503280030.j2S0U3Lp083151@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Wojciech A. Koszek" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8876A16A4CE for ; Mon, 28 Mar 2005 00:26:45 +0000 (GMT) Received: from freebsd.czest.pl (silver.iplus.pl [80.48.250.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 530F143D39 for ; Mon, 28 Mar 2005 00:26:42 +0000 (GMT) (envelope-from dunstan@freebsd.czest.pl) Received: from freebsd.czest.pl (freebsd.czest.pl [80.48.250.4]) by freebsd.czest.pl (8.12.10/8.12.9) with ESMTP id j2S0YLtf019157 for ; Mon, 28 Mar 2005 00:34:21 GMT (envelope-from dunstan@freebsd.czest.pl) Received: (from dunstan@localhost) by freebsd.czest.pl (8.12.10/8.12.9/Submit) id j2S0YK1X019156; Mon, 28 Mar 2005 00:34:20 GMT (envelope-from dunstan) Message-Id: <200503280034.j2S0YK1X019156@freebsd.czest.pl> Date: Mon, 28 Mar 2005 00:34:20 GMT From: "Wojciech A. Koszek" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/79292: [PATCH] ugidfw returns wrong number of inserted rule X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "Wojciech A. Koszek" List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2005 00:30:04 -0000 >Number: 79292 >Category: bin >Synopsis: [PATCH] ugidfw returns wrong number of inserted rule >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Mar 28 00:30:03 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Wojciech A. Koszek >Release: FreeBSD 5.4-PRERELEASE i386 >Organization: >Environment: System: FreeBSD dunstan.freebsd.czest.pl 5.4-PRERELEASE FreeBSD 5.4-PRERELEASE #10: Sat Feb 26 23:44:07 CET 2005 dunstan@dunstan.freebsd.czest.pl:/usr/obj/usr/src/sys/HOME7 i386 FreeBSD dunstan.freebsd.czest.pl 5.4-PRERELEASE FreeBSD 5.4-PRERELEASE #1: Fri Mar 25 23:16:47 CET 2005 dunstan@dunstan.freebsd.czest.pl:/usr/obj/usr/src-stable/sys/HOME8 i386 >Description: There is a bug in /usr/src/lib/libugidfw/ugidfw.c, function bsde_add_rule(). Prepending to *rulenum is skipped and incorrect rule number (0) is returned. >How-To-Repeat: root@dunstan:(/)# kldload /boot/kernel/mac_bsdextended.ko root@dunstan:(/)# kldstat | grep bsdext 21 1 0xc265b000 4000 mac_bsdextended.ko root@dunstan:(/)# ugidfw list 0 slots, 0 rules root@dunstan:(/)# ugidfw add subject uid 1028 object gid 100 mode r Added rule 0 root@dunstan:(/)# ugidfw add subject uid 1028 object gid 100 mode r Added rule 0 root@dunstan:(/)# ugidfw add subject uid 1028 object gid 100 mode r Added rule 0 root@dunstan:(/)# ugidfw add subject uid 1028 object gid 100 mode r Added rule 0 root@dunstan:(/)# ugidfw add subject uid 1028 object gid 100 mode r Added rule 0 root@dunstan:(/)# >Fix: Attached patch (diff.0.ugidfw.c) fixes this problem. --- diff.0.ugidfw.c begins here --- Index: src/lib/libugidfw/ugidfw.c =================================================================== RCS file: /home/ncvs/src/lib/libugidfw/ugidfw.c,v retrieving revision 1.7 diff -r1.7 ugidfw.c 746c746 < rule_slots; --- > *rulenum = rule_slots; --- diff.0.ugidfw.c ends here --- >Release-Note: >Audit-Trail: >Unformatted: