forked from CyanogenMod/android_packages_apps_Superuser
-
Notifications
You must be signed in to change notification settings - Fork 1
/
su.h
40 lines (30 loc) · 997 Bytes
/
su.h
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
#ifndef SU_h
#define SU_h 1
#define REQUESTOR_PACKAGE "com.noshufou.android.su"
#define REQUESTOR_CLASS "SuRequest"
#define REQUESTOR_DATA_PATH "/data/data/" REQUESTOR_PACKAGE
#define REQUESTOR_CACHE_PATH REQUESTOR_DATA_PATH "/cache"
#define DEFAULT_COMMAND "/system/bin/sh"
#define VERSION "2.2-ef"
struct su_initiator {
pid_t pid;
unsigned uid;
char bin[PATH_MAX];
char args[4096];
};
struct su_request {
unsigned uid;
char *command;
};
extern int do_request(struct su_initiator *from, struct su_request *to, const char *socket_path);
#if 0
#undef LOGE
#define LOGE(fmt,args...) fprintf(stderr, fmt , ## args )
#undef LOGD
#define LOGD(fmt,args...) fprintf(stderr, fmt , ## args )
#undef LOGW
#define LOGW(fmt,args...) fprintf(stderr, fmt , ## args )
#endif
#define PLOGE(fmt,args...) LOGE(fmt " failed with %d: %s" , ## args , errno, strerror(errno))
#define PLOGEV(fmt,err,args...) LOGE(fmt " failed with %d: %s" , ## args , err, strerror(err))
#endif