Allow su to work when manager uninstalled
This commit is contained in:
parent
2b6c271d37
commit
190d857949
3
db.c
3
db.c
@ -142,8 +142,7 @@ stat_requester:
|
|||||||
sprintf(buffer, "%s/0/%s", base, ctx->info->pkg_name);
|
sprintf(buffer, "%s/0/%s", base, ctx->info->pkg_name);
|
||||||
if (stat(buffer, &ctx->info->st) == -1) {
|
if (stat(buffer, &ctx->info->st) == -1) {
|
||||||
LOGE("su: cannot find requester");
|
LOGE("su: cannot find requester");
|
||||||
ctx->info->policy = DENY;
|
memset(&ctx->info->st, 0, sizeof(ctx->info->st));
|
||||||
ctx->notify = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
su.c
2
su.c
@ -309,7 +309,7 @@ int su_daemon_main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// New request or no db exist, notify user for response
|
// New request or no db exist, notify user for response
|
||||||
if (su_ctx->info->policy == QUERY) {
|
if (su_ctx->info->policy == QUERY && su_ctx->info->st.st_uid != 0) {
|
||||||
socket_serv_fd = socket_create_temp(su_ctx->sock_path, sizeof(su_ctx->sock_path));
|
socket_serv_fd = socket_create_temp(su_ctx->sock_path, sizeof(su_ctx->sock_path));
|
||||||
setup_sighandlers(cleanup_signal);
|
setup_sighandlers(cleanup_signal);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user