Skip to content

Commit fb9475d

Browse files
committed
su: Remove dead code
This is useless, _and_ comparing with an uninitialized variable. Not smart. Thanks to Jann Horn <jann@thejh.net> for the heads up. Change-Id: I637b4ecb40f735b668408373003d862685baa914
1 parent 9942ec8 commit fb9475d

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

su.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,6 @@ int su_main(int argc, char *argv[], int need_client) {
434434
.name = "",
435435
},
436436
};
437-
struct stat st;
438437
int c, socket_serv_fd, fd;
439438
char buf[64], *result;
440439
policy_t dballow;
@@ -536,12 +535,6 @@ int su_main(int argc, char *argv[], int need_client) {
536535
allow(&ctx, NULL);
537536
}
538537

539-
// always allow if this is the superuser uid
540-
// superuser needs to be able to reenable itself when disabled...
541-
if (ctx.from.uid == st.st_uid) {
542-
allow(&ctx, NULL);
543-
}
544-
545538
// check if superuser is disabled completely
546539
if (access_disabled(&ctx.from)) {
547540
ALOGD("access_disabled");

0 commit comments

Comments
 (0)