OSDN Git Service

Fix security, tighter str comparison, fix warnings
authorMarcos Marado <mmarado@cyngn.com>
Thu, 11 Dec 2014 20:41:24 +0000 (20:41 +0000)
committerRicardo Cerqueira <ricardo@cyngn.com>
Thu, 11 Dec 2014 22:54:37 +0000 (22:54 +0000)
commit2b782d197c4f09057bba9f3d7eceb722fbcf855d
tree1ab59807a4390f96ad6096a856300b3c715d9a04
parentc2ec204be3cea88296fe320636094858b82fc057
Fix security, tighter str comparison, fix warnings

 * When reading our and the caller's path, we were mistakingly reading only the
   first sizeof(char*) characters, so anything that was running from a path
   starting with '/sys' was being considered to be us
 * strcmp'ing strings instead of comparing only for the length of the first of
   them. Avoids possible executions from /system/xbin/suwhatever .
 * Fixed several compile-time warnings

Change-Id: I2af07f7bf5078acd0c36bd22b74fbc01276957be
Superuser/jni/su/daemon.c
Superuser/jni/su/pts.c
Superuser/jni/su/su.c