Sunday, March 11, 2018

Effective groupids on Android

to get the effective gids :

root@rootedbox:/system # grep com.example.bla /data/system/packages.list

com.example.bla 10064 0 /data/data/com.example.bla default 1028,1015,3003,3002,3001

for list of gids check here ( eg.: AID_SDCARD_RW is 1015 ):

https://android.googlesource.com/platform/system/core/+/master/libcutils/include/private/android_filesystem_config.h

open is implemented here :

https://android.googlesource.com/platform/bionic/+/master/libc/bionic/open.cpp

ls is implemented in toolbox, here : 

https://android.googlesource.com/platform/system/core.git/+/android-4.2.2_r1/toolbox/ls.c

ls maps uids to usernames using getpwuid(), defined here :

https://android.googlesource.com/platform/bionic/+/52d6233296ec84eb5b58fcbf7bc9da4b96a943aa/libc/bionic/stubs.c

'struct passwd' that is returned is defined here :

 https://android.googlesource.com/platform/bionic/+/882b8af/libc/include/pwd.h

No comments:

Post a Comment