Commit 190d8579 authored by topjohnwu's avatar topjohnwu

Allow su to work when manager uninstalled

parent 2b6c271d
......@@ -142,8 +142,7 @@ stat_requester:
sprintf(buffer, "%s/0/%s", base, ctx->info->pkg_name);
if (stat(buffer, &ctx->info->st) == -1) {
LOGE("su: cannot find requester");
ctx->info->policy = DENY;
ctx->notify = 0;
memset(&ctx->info->st, 0, sizeof(ctx->info->st));
}
}
}
......@@ -309,7 +309,7 @@ int su_daemon_main(int argc, char **argv) {
}
// 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));
setup_sighandlers(cleanup_signal);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment