freebsd-skq/lib/libc
rwatson a3a7830365 As new objects begin to support new labels, start to generalize
the default label support in /etc/mac.conf.  Rather than maintain
each default label type in an explicit global variable in mac.c,
keep a list of defaults loaded from the configuration file.
Generalize the parsing so that we support both the older:

        default_file_labels foo
        default_ifnet_labels foo
        default_process_labels foo

And also a new:

        default_labels file foo
        default_labels ifnet foo
        default_labels process foo

We now accept arbitrary object classes in the first argument.  If
the same object is specified more than once, we discard the
earlier definition in favor of the later one.

Add a new API, mac_prepare_type(), which accepts a mac_t to
prepare, as well as an object name in the second argument, which
will pull a default label set for the object out of the
configuration loaded by mac_init_internal().  This permits the libc
to adapt to new objects known about by applications but not by libc
at compile-time.

Also liberalize the error handling a bit: if we're using implicit
initialization (i.e., the application didn't explicitly initialize
the MAC code), ignore syntax errors and only use valid lines.  In
the future, we may want to add explicit warnings and do this a
bit more consistently.

While here, add support for a MAC_CONFFILE environmental variable,
which may be used to specify an alternative mac.conf configuration
file if the application isn't running with modified privilege
(issetugid()).

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-08-22 17:36:23 +00:00
..
alpha Fix wrong identifier on .end directive. The SYSCALL macro does name 2003-08-16 18:59:08 +00:00
amd64 Add the mlockall() and munlockall() system calls. 2003-08-11 07:14:08 +00:00
compat-43 Explain the relationship to POSIX. 2003-06-20 22:41:00 +00:00
db Fix a sizeof error in __bt_put: when writing they key and data sizes 2003-05-30 11:05:08 +00:00
gdtoa Userland spinlocks bad. Sleep locks good. 2003-06-21 08:20:14 +00:00
gen Add a kluge suggested by Marcel to paper over the difference between 2003-08-19 23:01:46 +00:00
gmon Use C99 compatible ASM statements. 2003-06-02 02:32:22 +00:00
i386 Add the mlockall() and munlockall() system calls. 2003-08-11 07:14:08 +00:00
ia64 Add the mlockall() and munlockall() system calls. 2003-08-11 07:14:08 +00:00
include Back out the `hiding' of strlcpy and strlcat. Several people 2003-05-01 19:03:14 +00:00
locale Fix the case of the encoding name in the ENCODING line. Names are 2003-08-10 11:41:38 +00:00
net An u_int8_t can never be bigger than 255, so remove a useless check. 2003-07-25 12:23:25 +00:00
nls Back out the `hiding' of strlcpy and strlcat. Several people 2003-05-01 19:03:14 +00:00
posix1e As new objects begin to support new labels, start to generalize 2003-08-22 17:36:23 +00:00
powerpc Add the mlockall() and munlockall() system calls. 2003-08-11 07:14:08 +00:00
quad libc_r wasn't so tied to libc for 22 months. 2002-11-18 09:50:57 +00:00
regex Eliminate 61 warnings emitted at WARNS=2 (leaving 53 to go). 2003-02-16 17:29:11 +00:00
rpc Kill prototype for __msgwrite too. It is not needed anymore. 2003-06-15 10:55:39 +00:00
sparc64 Add the mlockall() and munlockall() system calls. 2003-08-11 07:14:08 +00:00
stdio Add more useful cross-references to the SEE ALSO section. 2003-07-05 07:55:34 +00:00
stdlib Replace some syscalls with libc version, this makes abort work better with 2003-08-16 11:43:57 +00:00
stdtime Fixes to locale code to properly use indirect pointers in order to prevent 2003-06-13 00:14:07 +00:00
string * Merge index(3) and rindex(3) to index(3) since the two functions are 2003-07-28 22:50:42 +00:00
sys Make the documentation of PT_STEP match its implementation: the 2003-08-11 13:13:46 +00:00
uuid Remove stale DCE 1.1 pointers to the IBM site. The URLs aren't valid 2003-08-08 19:18:43 +00:00
xdr Fix amd(8) clients, if a FreeBSD mountd(8) server is used. 2003-05-28 09:13:09 +00:00
yp Back out the `hiding' of strlcpy and strlcat. Several people 2003-05-01 19:03:14 +00:00
Makefile Add a kluge suggested by Marcel to paper over the difference between 2003-08-19 23:01:46 +00:00