forked from abcz316/SKRoot-linuxKernelRoot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsu.h
More file actions
62 lines (53 loc) · 1.15 KB
/
Copy pathsu.h
File metadata and controls
62 lines (53 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef _SU_H_
#define _SU_H_
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <string.h>
#include <pwd.h>
#include <dirent.h>
#include <time.h>
#include <iostream>
#include <memory>
#include <vector>
#include <map>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/wait.h>
#include <sys/select.h>
#include <sys/time.h>
#include <sys/prctl.h>
#include <sys/types.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <getopt.h>
#include <stdarg.h>
#include <pthread.h>
#include <sched.h>
#include <termios.h>
#include <signal.h>
#include <libgen.h>
#include <poll.h>
#define DEFAULT_SHELL "/system/bin/sh"
// Constants for atty
#define ATTY_IN (1 << 0)
#define ATTY_OUT (1 << 1)
#define ATTY_ERR (1 << 2)
#define UID_ROOT 0
#define UID_SHELL 2000
#define ROOT_VER_CODE 1
#define ROOT_VERSION "1.0"
struct su_req_base {
int uid = UID_ROOT;
bool login = false;
bool keepenv = false;
bool mount_master = false;
} __attribute__((packed));
struct su_request : public su_req_base {
std::string shell = DEFAULT_SHELL;
std::string command;
};
#endif /* _SU_H_ */