> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/man/man4/mac_stub.4.md).

# mac\_stub.4

`mac_stub` — MAC 策略桩模块

## 名称

`mac_stub`

## 概要

要将桩策略编译进内核，请在内核配置文件中加入以下行：

> options MAC options MAC\_STUB

或者，要在引导时加载 stub 模块，请在内核配置文件中加入以下行：

> options MAC

并在 loader.conf(5) 中加入：

```sh
mac_stub_load="YES"
```

## 描述

`mac_stub` 策略模块实现了一个桩 MAC 策略，对系统中的访问控制没有任何影响。与 [mac\_none(4)](/man/man4/mac_none.4.md) 不同，每个 MAC 入口点都被定义为“no-op”，因此该策略模块会在每个事件中被调用，但不会对系统行为产生任何改变。

### 标签格式

`mac_stub` 未定义任何标签。

## 参见

[mac(4)](/man/man4/mac.4.md), [mac\_biba(4)](/man/man4/mac_biba.4.md), [mac\_bsdextended(4)](/man/man4/mac_bsdextended.4.md), [mac\_ddb(4)](/man/man4/mac_ddb.4.md), [mac\_ifoff(4)](/man/man4/mac_ifoff.4.md), [mac\_lomac(4)](/man/man4/mac_lomac.4.md), [mac\_mls(4)](/man/man4/mac_mls.4.md), [mac\_none(4)](/man/man4/mac_none.4.md), [mac\_partition(4)](/man/man4/mac_partition.4.md), [mac\_portacl(4)](/man/man4/mac_portacl.4.md), [mac\_seeotheruids(4)](/man/man4/mac_seeotheruids.4.md), [mac\_test(4)](/man/man4/mac_test.4.md), [mac(9)](/man/man9/mac.9.md)

## 历史

`mac_stub` 策略模块首次出现于 FreeBSD 5.1，由 TrustedBSD 项目开发。

## 作者

本软件由 Network Associates Labs（Network Associates Inc. 的安全研究部门）在 DARPA/SPAWAR 合同 N66001-01-C-8035（“CBOSS”）下，作为 DARPA CHATS 研究计划的一部分，贡献给 FreeBSD 项目。

## 缺陷

虽然 MAC 框架的设计意图是支持对 root 用户的限制，但目前并非所有攻击通道都受到入口点检查的保护。因此，不应单独依赖 MAC 框架策略来防御恶意的特权用户。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/man/man4/mac_stub.4.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
