Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Mar 2005 00:34:20 GMT
From:      "Wojciech A. Koszek" <dunstan@freebsd.czest.pl>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/79292: [PATCH] ugidfw returns wrong number of inserted rule
Message-ID:  <200503280034.j2S0YK1X019156@freebsd.czest.pl>
Resent-Message-ID: <200503280030.j2S0U3Lp083151@freefall.freebsd.org>

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

>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:



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