git: c0f6eaf5a8ff - stable/15 - MAC/do: Constify clone_rules() and clone_exec_paths()'s source argument

From: Olivier Certner <olce_at_FreeBSD.org>
Date: Mon, 29 Jun 2026 19:25:46 UTC
The branch stable/15 has been updated by olce:

URL: https://cgit.FreeBSD.org/src/commit/?id=c0f6eaf5a8ff6a74b84dc8a090a9db527f518a0a

commit c0f6eaf5a8ff6a74b84dc8a090a9db527f518a0a
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2026-04-27 16:24:01 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2026-06-29 19:23:44 +0000

    MAC/do: Constify clone_rules() and clone_exec_paths()'s source argument
    
    Defensive programming.
    
    Reviewed by:    bapt
    MFC after:      1 month
    Sponsored by:   The FreeBSD Foundation
    Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
    
    (cherry picked from commit 68cc6aa2e93a2a2969eb40b5588452eeb1805fa6)
---
 sys/security/mac_do/mac_do.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sys/security/mac_do/mac_do.c b/sys/security/mac_do/mac_do.c
index 8276ac3f9bc5..f2206c85c489 100644
--- a/sys/security/mac_do/mac_do.c
+++ b/sys/security/mac_do/mac_do.c
@@ -1352,7 +1352,7 @@ set_default_conf(struct prison *const pr)
  */
 
 static void
-clone_rules(struct rules *dst, struct rules *const src)
+clone_rules(struct rules *const dst, const struct rules *const src)
 {
 	struct rule *src_rule, *dst_rule;
 
@@ -1384,7 +1384,8 @@ clone_rules(struct rules *dst, struct rules *const src)
 }
 
 static void
-clone_exec_paths(struct exec_paths *dst, struct exec_paths *const src)
+clone_exec_paths(struct exec_paths *const dst,
+    const struct exec_paths *const src)
 {
 	bzero(dst, sizeof(*dst));
 	dst->exec_path_count = src->exec_path_count;