Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Patched uid=0 check to ignore gid, since it is non-zero on some

android phones after calling su/setuid().  Tried setguid(0) to no
avail.
  • Loading branch information...
commit 309e473e5e545953621d62c4dbc793bcddd78d4f 1 parent 88cf061
@gardners gardners authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 posix/posix.c
View
5 posix/posix.c
@@ -603,8 +603,9 @@ int main(int argc, char *argv[])
int8_t res;
/* check if user is root */
- if ((getuid()) || (getgid())) {
- fprintf(stderr, "Error - you must be root to run '%s' !\n", argv[0]);
+ /* PGS: On some Android phones, it is not possible to set gid to zero. So only check uid. */
+ if ((getuid()) /* || (getgid()) */) {
+ fprintf(stderr, "Error - you must be root to run '%s' ! (uid=%d, gid=%d)\n", argv[0],getuid(),getgid());
exit(EXIT_FAILURE);
}
Please sign in to comment.
Something went wrong with that request. Please try again.