1.\" Copyright (c) 2003 Networks Associates Technology, Inc. 2.\" All rights reserved. 3.\" 4.\" This software was developed for the FreeBSD Project by Chris 5.\" Costello at Safeport Network Services and Network Associates 6.\" Laboratories, the Security Research Division of Network Associates, 7.\" Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part 8.\" of the DARPA CHATS research program. 9.\" 10.\" Redistribution and use in source and binary forms, with or without 11.\" modification, are permitted provided that the following conditions 12.\" are met: 13.\" 1. Redistributions of source code must retain the above copyright 14.\" notice, this list of conditions and the following disclaimer. 15.\" 2. Redistributions in binary form must reproduce the above copyright 16.\" notice, this list of conditions and the following disclaimer in the 17.\" documentation and/or other materials provided with the distribution. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND 20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" SUCH DAMAGE. 30.\" 31.\" $FreeBSD$ 32.\" 33.Dd February 25, 2004 34.Os 35.Dt LIBUGIDFW 3 36.Sh NAME 37.Nm libugidfw 38.Nd "library interface to the file system firewall MAC policy" 39.Sh LIBRARY 40.Lb libugidfw 41.Sh SYNOPSIS 42.In sys/types.h 43.In security/mac_bsdextended/mac_bsdextended.h 44.In ugidfw.h 45.Sh DESCRIPTION 46The 47.Nm 48library routines provide an interface to the 49.Xr mac_bsdextended 4 50file system firewall MAC policy. 51.Pp 52The 53.Nm 54library defines the following functions: 55.Bl -tag -width ".Fn bsde_parse_rule_string" 56.It Fn bsde_rule_to_string 57Converts the internal representation of a rule 58.Pq Vt "struct mac_bsdextended_rule" 59into its text representation; 60see 61.Xr bsde_rule_to_string 3 . 62.It Fn bsde_parse_identity 63Parses the identity of a subject or object; 64see 65.Xr bsde_parse_identity 3 . 66.It Fn bsde_parse_mode 67Parses the access mode for a ugidfw rule; 68see 69.Xr bsde_parse_mode 3 . 70.It Fn bsde_parse_rule 71Parses an entire rule 72(in argument array form); 73see 74.Xr bsde_parse_rule 3 . 75.It Fn bsde_parse_rule_string 76Parses an entire rule string; 77see 78.Xr bsde_parse_rule_string 3 . 79.It Fn bsde_get_rule_count 80Returns the total number of ugidfw rules being enforced in the system; 81see 82.Xr bsde_get_rule_count 3 . 83.It Fn bsde_get_rule_slots 84Returns the total number of used rule slots; 85see 86.Xr bsde_get_rule_slots 3 . 87.It Fn bsde_get_rule 88Returns a rule by its rule number; 89see 90.Xr bsde_get_rule 3 . 91.It Fn bsde_delete_rule 92Deletes a rule by its rule number; 93see 94.Xr bsde_delete_rule 3 . 95.It Fn bsde_set_rule 96Uploads the rule to the 97.Xr mac_bsdextended 4 98module and applies it; 99see 100.Xr bsde_set_rule 3 . 101.It Fn bsde_add_rule 102Upload the rule to the module, automatically selecting the next available 103rule number; see 104.Xr bsde_add_rule 3 . 105.El 106.Sh SEE ALSO 107.Xr bsde_delete_rule 3 , 108.Xr bsde_get_rule 3 , 109.Xr bsde_get_rule_count 3 , 110.Xr bsde_get_rule_slots 3 , 111.Xr bsde_parse_identity 3 , 112.Xr bsde_parse_mode 3 , 113.Xr bsde_parse_rule 3 , 114.Xr bsde_parse_rule_string 3 , 115.Xr bsde_rule_to_string 3 , 116.Xr bsde_set_rule 3 117.Sh AUTHORS 118This software was contributed to the 119.Fx 120Project by Network Associates Labs, 121the Security Research Division of Network Associates 122Inc. 123under DARPA/SPAWAR contract N66001-01-C-8035 124.Pq Dq CBOSS , 125as part of the DARPA CHATS research program. 126