Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logger for sys/security/mac_do/mac_do.c #1513

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Rin0913
Copy link
Contributor

@Rin0913 Rin0913 commented Nov 3, 2024

Add logger for mac_do module.

The output format is like following:

Nov  4 05:32:43 bsd-workstation syslogd: last message repeated 18 times
Nov  4 05:32:43 bsd-workstation kernel: Uid 1001 met the condition and will be granted privileges.
Nov  4 05:32:43 bsd-workstation syslogd: last message repeated 1 times
Nov  4 05:32:45 bsd-workstation kernel: Uid 1001 failed to meet the condition.
Nov  4 05:32:51 bsd-workstation syslogd: last message repeated 13 times
Nov  4 05:33:00 bsd-workstation kernel: Uid 2 failed to meet the condition.
Nov  4 05:33:00 bsd-workstation syslogd: last message repeated 56 times
Nov  4 05:33:17 bsd-workstation kernel: Uid 1001 failed to meet the condition.

I don't know why the message would be repeated so many times, which seems to be irrelevant with the mac_do module, needs some improvement here.

@@ -432,13 +433,15 @@ priv_grant(struct ucred *cred, int priv)
switch (priv) {
case PRIV_CRED_SETGROUPS:
case PRIV_CRED_SETUID:
log(LOG_SECURITY | LOG_INFO, "Uid %d met the condition and will be granted privileges.\n", cred->cr_uid);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uid should be UID (all capital words)
same for the other one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants