MAC/do: Executable paths: Accept an empty string

This effectively allows to disable mac_do(4) by setting the executable
paths to an empty string, realizing a symmetry with rules to be
leveraged in subsequent commits.

Reviewed by:    bapt
Fixes:          9818224174 ("MAC/do: Executable paths feature (GSoC 2025's final state)")
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
This commit is contained in:
Olivier Certner
2026-04-28 15:37:50 +02:00
parent 0aef1c059f
commit 3a4433425e
-6
View File
@@ -1151,12 +1151,6 @@ parse_exec_paths(const char *const string, struct exec_paths *const exec_paths,
exec_paths->exec_path_count++;
}
if (exec_paths->exec_path_count == 0) {
make_parse_error(parse_error, 0, "No valid exec paths found");
error = EINVAL;
goto error;
}
MPASS(error == 0 && *parse_error == NULL);
out:
free(copy, M_MAC_DO);