git: 081218b7a200 - main - libc: fix description issues in mac_text(3)/mac_free(3)
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 26 Oct 2025 15:14:20 UTC
The branch main has been updated by kevans:
URL: https://cgit.FreeBSD.org/src/commit/?id=081218b7a2006e5b6783e51f66fd751871ac1272
commit 081218b7a2006e5b6783e51f66fd751871ac1272
Author: Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2025-10-26 15:10:34 +0000
Commit: Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2025-10-26 15:13:21 +0000
libc: fix description issues in mac_text(3)/mac_free(3)
mac_text(3) as-written would seem to indicate that a `mac_t` should be
freed with free(3), but this isn't the case. One can derive from
context from when the change was introduced and COMPATIBILITY that this
was intended to talk about *text in `mac_to_text`, so move the comment
there.
PR: 179832
Co-authored-by: Priit Järv <priit cc ttu ee>
MFC after: 3 days
---
lib/libc/posix1e/mac_free.3 | 4 ++--
lib/libc/posix1e/mac_text.3 | 8 +++++---
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/lib/libc/posix1e/mac_free.3 b/lib/libc/posix1e/mac_free.3
index 4ed68b70f3a3..6674ca2e9094 100644
--- a/lib/libc/posix1e/mac_free.3
+++ b/lib/libc/posix1e/mac_free.3
@@ -31,7 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd September 21, 2023
+.Dd October 26, 2025
.Dt MAC_FREE 3
.Os
.Sh NAME
@@ -85,7 +85,7 @@ is a complex structure in the
implementation,
.Fn mac_free
is specific to
-.Vt mac_3 ,
+.Vt mac_t ,
and must not be used to free the character strings returned from
.Fn mac_to_text .
Doing so may result in undefined behavior.
diff --git a/lib/libc/posix1e/mac_text.3 b/lib/libc/posix1e/mac_text.3
index 29c1aacca485..7633f4b0da64 100644
--- a/lib/libc/posix1e/mac_text.3
+++ b/lib/libc/posix1e/mac_text.3
@@ -28,7 +28,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd September 21, 2023
+.Dd October 26, 2025
.Dt MAC_TEXT 3
.Os
.Sh NAME
@@ -52,14 +52,16 @@ into the internal policy label format
and places it in
.Fa *mac ,
which must later be freed with
-.Xr free 3 .
+.Xr mac_free 3 .
.Pp
The
.Fn mac_to_text
function allocates storage for
.Fa *text ,
which will be set to the text representation of
-.Fa label .
+.Fa label
+and must later be freed with
+.Xr free 3 .
.Pp
Refer to
.Xr maclabel 7