summaryrefslogtreecommitdiffstats
path: root/lib/libc/posix1e
diff options
context:
space:
mode:
authorchris <chris@FreeBSD.org>2002-10-24 01:01:29 +0000
committerchris <chris@FreeBSD.org>2002-10-24 01:01:29 +0000
commit42f90ed7abf25bd99b0acdcd93c6e9f644e0b875 (patch)
treeef6b8412374ea774991a2ee56d3724d481f43fbe /lib/libc/posix1e
parenta20ce31a589e9e23445a90849727252ecd52ce91 (diff)
downloadFreeBSD-src-42f90ed7abf25bd99b0acdcd93c6e9f644e0b875.zip
FreeBSD-src-42f90ed7abf25bd99b0acdcd93c6e9f644e0b875.tar.gz
mac_free() no longer accepts a void * parameter; only mac_t's are supposed
to be passed. Point this out in a warning notice, which will eventually go away, sometime between now and -RELEASE. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
Diffstat (limited to 'lib/libc/posix1e')
-rw-r--r--lib/libc/posix1e/mac_free.329
1 files changed, 20 insertions, 9 deletions
diff --git a/lib/libc/posix1e/mac_free.3 b/lib/libc/posix1e/mac_free.3
index a29be1a..ab39b45 100644
--- a/lib/libc/posix1e/mac_free.3
+++ b/lib/libc/posix1e/mac_free.3
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2001 Networks Associates Technology, Inc.
+.\" Copyright (c) 2001, 2002 Networks Associates Technology, Inc.
.\" All rights reserved.
.\"
.\" This software was developed for the FreeBSD Project by Chris
@@ -43,21 +43,18 @@
.Sh SYNOPSIS
.In sys/mac.h
.Ft int
-.Fn mac_free "void *buf_p"
+.Fn mac_free "mac_t label"
.Sh DESCRIPTION
The
.Fn mac_free
-function frees the storage allocated to contain either a
-.Vt mac_t
-or a
-.Vt char * ,
-as allocated by the
-.Fn mac_to_text
-function.
+function frees the storage allocated to contain a
+.Vt mac_t .
.Sh RETURN VALUES
The
.Fn mac_free
function always returns 0.
+WARNING: see the notes in the BUGS section regarding the use of this
+function.
.Sh SEE ALSO
.Xr mac 3 ,
.Xr mac_get 3 ,
@@ -71,3 +68,17 @@ To join this list, see the
.Fx
POSIX.1e implementation page
for more information.
+.Sh BUGS
+POSIX.1e specifies that
+.Fn mac_free
+will be used to free text strings created using
+.Xr mac_to_text 3 .
+Because
+.Vt mac_t
+is a complex structure in the TrustedBSD implementation,
+.Fn mac_free
+is specific to that type, and must not be used to free the character
+strings returned from
+.Fn mac_to_text .
+Doing so may result in undefined behavior,
+including application failure.
OpenPOWER on IntegriCloud