Use SO_PEERSEC to get client secontext

This commit is contained in:
topjohnwu
2021-10-19 23:46:38 -07:00
parent fe41df87bb
commit 8d0dc37ec0
7 changed files with 47 additions and 43 deletions

View File

@ -158,13 +158,13 @@ static void set_identity(unsigned uid) {
}
}
void su_daemon_handler(int client, struct ucred *credential) {
LOGD("su: request from pid=[%d], client=[%d]\n", credential->pid, client);
void su_daemon_handler(int client, const sock_cred *cred) {
LOGD("su: request from pid=[%d], client=[%d]\n", cred->pid, client);
su_context ctx = {
.info = get_su_info(credential->uid),
.info = get_su_info(cred->uid),
.req = su_request(),
.pid = credential->pid
.pid = cred->pid
};
// Read su_request