process-util: introduce trivial proc_set_nnp() helper

This commit is contained in:
Lennart Poettering
2026-07-13 15:39:16 +02:00
parent 0e077d3eea
commit 3ac3632e28
6 changed files with 24 additions and 13 deletions
+4
View File
@@ -2292,3 +2292,7 @@ int prctl_safe(int op, unsigned long arg2, unsigned long arg3, unsigned long arg
int proc_set_comm(const char *comm) {
return prctl_safe(PR_SET_NAME, (unsigned long) comm, 0, 0, 0);
}
int proc_set_nnp(void) {
return prctl_safe(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
}
+1
View File
@@ -259,3 +259,4 @@ int read_errno(int errno_fd);
int prctl_safe(int op, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5);
int proc_set_comm(const char *comm);
int proc_set_nnp(void);