mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-22 16:07:39 +00:00
Better logging
This commit is contained in:
parent
9e1322de25
commit
985454afd4
@ -58,6 +58,7 @@ class SuRequestHandler(
|
|||||||
val pid = intent.getIntExtra("pid", -1)
|
val pid = intent.getIntExtra("pid", -1)
|
||||||
val fifo = intent.getStringExtra("fifo")
|
val fifo = intent.getStringExtra("fifo")
|
||||||
if (uid <= 0 || pid <= 0 || fifo == null) {
|
if (uid <= 0 || pid <= 0 || fifo == null) {
|
||||||
|
Timber.e("Unexpected extras: uid=[${uid}], pid=[${pid}], fifo=[${fifo}]")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
output = File(fifo)
|
output = File(fifo)
|
||||||
@ -73,7 +74,11 @@ class SuRequestHandler(
|
|||||||
respond(SuPolicy.DENY, -1)
|
respond(SuPolicy.DENY, -1)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return output.canWrite()
|
if (!output.canWrite()) {
|
||||||
|
Timber.e("Cannot write to $output")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun respond(action: Int, time: Int) {
|
suspend fun respond(action: Int, time: Int) {
|
||||||
|
@ -165,8 +165,6 @@ void prune_su_access() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static shared_ptr<su_info> get_su_info(unsigned uid) {
|
static shared_ptr<su_info> get_su_info(unsigned uid) {
|
||||||
LOGD("su: request from uid=[%d]\n", uid);
|
|
||||||
|
|
||||||
if (uid == AID_ROOT) {
|
if (uid == AID_ROOT) {
|
||||||
auto info = make_shared<su_info>(uid);
|
auto info = make_shared<su_info>(uid);
|
||||||
info->access = SILENT_SU_ACCESS;
|
info->access = SILENT_SU_ACCESS;
|
||||||
@ -252,7 +250,7 @@ static void set_identity(uid_t uid, const std::vector<uid_t> &groups) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void su_daemon_handler(int client, const sock_cred *cred) {
|
void su_daemon_handler(int client, const sock_cred *cred) {
|
||||||
LOGD("su: request from pid=[%d], client=[%d]\n", cred->pid, client);
|
LOGD("su: request from uid=[%d], pid=[%d], client=[%d]\n", cred->uid, cred->pid, client);
|
||||||
|
|
||||||
su_context ctx = {
|
su_context ctx = {
|
||||||
.info = get_su_info(cred->uid),
|
.info = get_su_info(cred->uid),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user