mknodat: add auth check for device nodes

This commit is contained in:
Matheus
2026-05-13 18:24:33 -03:00
parent 38221a0d03
commit 5cfc6cf782
3 changed files with 16 additions and 0 deletions
+9
View File
@@ -94,6 +94,15 @@ static int filesystem(cred_t *cred, int actions, void *arg0, void *arg1, void *a
DONE_CHECK(actions);
}
if (actions & AUTH_ACTIONS_FILESYSTEM_MKNOD) {
if (CRED_IS_ESU(cred))
weight += 1;
else
return AUTH_DECISION_DENY;
DONE_CHECK(actions);
}
if (actions & (AUTH_ACTIONS_FILESYSTEM_UNLINK | AUTH_ACTIONS_FILESYSTEM_RENAME)) {
__assert(dirvnode);