36 lines
658 B
C
36 lines
658 B
C
#ifndef __KSU_H_KSU
|
|
#define __KSU_H_KSU
|
|
|
|
#include "linux/workqueue.h"
|
|
|
|
#define KERNEL_SU_VERSION 11
|
|
|
|
#define KERNEL_SU_OPTION 0xDEADBEEF
|
|
|
|
#define CMD_GRANT_ROOT 0
|
|
|
|
#define CMD_BECOME_MANAGER 1
|
|
#define CMD_GET_VERSION 2
|
|
#define CMD_ALLOW_SU 3
|
|
#define CMD_DENY_SU 4
|
|
#define CMD_GET_ALLOW_LIST 5
|
|
#define CMD_GET_DENY_LIST 6
|
|
|
|
bool ksu_queue_work(struct work_struct *work);
|
|
|
|
static inline int startswith(char *s, char *prefix)
|
|
{
|
|
return strncmp(s, prefix, strlen(prefix));
|
|
}
|
|
|
|
static inline int endswith(const char *s, const char *t)
|
|
{
|
|
size_t slen = strlen(s);
|
|
size_t tlen = strlen(t);
|
|
if (tlen > slen)
|
|
return 1;
|
|
return strcmp(s + slen - tlen, t);
|
|
}
|
|
|
|
#endif
|