Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

bsde_delete_rule(3) [freebsd man page]

BSDE_GET_RULE(3)					   BSD Library Functions Manual 					  BSDE_GET_RULE(3)

NAME
bsde_add_rule, bsde_get_rule, bsde_set_rule, bsde_delete_rule -- file system firewall rules list management LIBRARY
File System Firewall Interface Library (libugidfw, -lugidfw) SYNOPSIS
#include <ugidfw.h> int bsde_add_rule(int *rulenum, struct mac_bsdextended_rule *rule, size_t buflen, char *errstr); int bsde_get_rule(int rulenum, struct mac_bsdextended_rule *rule, size_t errlen, char *errstr); int bsde_set_rule(int rulenum, struct mac_bsdextended_rule *rule, size_t errlen, char *errstr); int bsde_delete_rule(int rulenum, size_t errlen, char *errstr); DESCRIPTION
The bsde_add_rule() function fills the next available rule (in struct mac_bsdextended_rule form, either from bsde_get_rule() or bsde_parse_rule(3)). If an error occurs, *errstr is filled with the error string (up to errlen characters, including the terminating NUL). If successful and rulenum is non-NULL, the rule number used will be returned in *rulenum. The bsde_get_rule() function fills in *rule with the rule numbered rulenum. If an error occurs, *errstr is filled in with the error string (up to errlen characters, including the terminating NUL). The bsde_set_rule() function fills the slot numbered rulenum with the specified rule (in struct mac_bsdextended_rule form, either from bsde_get_rule() or bsde_parse_rule(3)). If an error occurs, *errstr is filled with the error string (up to errlen characters, including the terminating NUL). The bsde_delete_rule() function deletes the rule numbered rulenum. If an error occurs, *errstr is filled with the error string (up to errlen characters, including the terminating NUL). RETURN VALUES
The bsde_get_rule(), bsde_set_rule(), and bsde_delete_rule() functions return 0 if successful; otherwise the value -1 is returned and the value of *errstr is filled in as documented in DESCRIPTION. SEE ALSO
bsde_get_rule_count(3), bsde_get_rule_slots(3), bsde_parse_rule(3), bsde_parse_rule_string(3), bsde_rule_to_string(3), libugidfw(3), mac_bsdextended(4), ugidfw(8) AUTHORS
This software was contributed to the FreeBSD Project by Network Associates Labs, the Security Research Division of Network Associates Inc. under DARPA/SPAWAR contract N66001-01-C-8035 (``CBOSS''), as part of the DARPA CHATS research program. BSD
February 24, 2004 BSD

Check Out this Related Man Page

UGIDFW(8)						    BSD System Manager's Manual 						 UGIDFW(8)

NAME
ugidfw -- firewall-like access controls for file system objects SYNOPSIS
ugidfw add subject [not] [[!] uid uid | minuid:maxuid] [[!] gid gid | mingid:maxgid] [[!] jailid jailid] object [not] [[!] uid uid | minuid:maxuid] [[!] gid gid | mingid:maxgid] [[!] filesys path] [[!] suid] [[!] sgid] [[!] uid_of_subject] [[!] gid_of_subject] [[!] type ardbclsp] mode arswxn ugidfw list ugidfw set rulenum subject [not] [[!] uid uid | minuid:maxuid] [[!] gid gid | mingid:maxgid] [[!] jailid jailid] object [not] [[!] uid uid | minuid:maxuid] [[!] gid gid | mingid:maxgid] [[!] filesys path] [[!] suid] [[!] sgid] [[!] uid_of_subject] [[!] gid_of_subject] [[!] type ardbclsp] mode arswxn ugidfw remove rulenum DESCRIPTION
The ugidfw utility provides an ipfw(8)-like interface to manage access to file system objects by UID and GID, supported by the mac_bsdextended(4) mac(9) policy. The arguments are as follows: add subject ... object ... mode arswxn Add a new rule, automatically selecting the rule number. See the description of set for syntax information. list Produces a list of all the current ugidfw rules in the system. set rulenum subject ... object ... mode arswxn Add a new rule or modify an existing rule. The arguments are as follows: rulenum Rule number. Entries with a lower rule number are applied first; placing the most frequently-matched rules at the beginning of the list (i.e., lower-numbered) will yield a slight performance increase. subject [not] [[!] uid uid | minuid:maxuid] [[!] gid gid | mingid:maxgid] [[!] jailid jailid] Subjects performing an operation must match all the conditions given. A leading not means that the subject should not match the remainder of the specification. A condition may be prefixed by ! to indicate that particular condition must not match the subject. The subject can be required to have a particular uid and/or gid. A range of uids/gids can be specified, separated by a colon. The subject can be required to be in a particular jail with the jailid. object [not] [[!] uid uid | minuid:maxuid] [[!] gid gid | mingid:maxgid] [[!] filesys path] [[!] suid] [[!] sgid] [[!] uid_of_subject] [[!] gid_of_subject] [[!] type ardbclsp] The rule will apply only to objects matching all the specified conditions. A leading not means that the object should not match all the remaining conditions. A condition may be prefixed by ! to indicate that particular condition must not match the object. Objects can be required to be owned by the user and/or group specified by uid and/or gid. A range of uids/gids can be specified, separated by a colon. The object can be required to be in a particular filesys- tem by specifying the filesystem using filesys. Note, if the filesystem is unmounted and remounted, then the rule may need to be reapplied to ensure the correct filesystem id is used. The object can be required to have the suid or sgid bits set. The owner of the object can be required to match the uid_of_subject or the gid_of_subject attempting the operation. The type of the object can be restricted to a subset of the following types. a any file type r a regular file d a directory b a block special device c a character special device l a symbolic link s a unix domain socket p a named pipe (FIFO) mode arswxn Similar to chmod(1), each character represents an access mode. If the rule applies, the specified access permissions are enforced for the object. When a character is specified in the rule, the rule will allow for the operation. Con- versely, not including it will cause the operation to be denied. The definitions of each character are as follows: a administrative operations r read access s access to file attributes w write access x execute access n none remove rulenum Disable and remove the rule with the specified rule number. SEE ALSO
mac_bsdextended(4), mac(9) HISTORY
The ugidfw utility first appeared in FreeBSD 5.0. AUTHORS
This software was contributed to the FreeBSD Project by NAI Labs, the Security Research Division of Network Associates Inc. under DARPA/SPAWAR contract N66001-01-C-8035 (``CBOSS''), as part of the DARPA CHATS research program. BSD
February 24, 2004 BSD
Man Page