summaryrefslogtreecommitdiffstats
path: root/cmds/keystore/keystore.c
diff options
context:
space:
mode:
authorChia-chi Yeh <chiachi@android.com>2010-03-09 09:41:32 +0800
committerChia-chi Yeh <chiachi@android.com>2010-03-09 09:44:07 +0800
commite3bc02347197a49aa061084073bde9fbea90cb80 (patch)
treecf33c9b0c85e98c1688ee40f78c9387298f1f119 /cmds/keystore/keystore.c
parenteb8e5e45f83519277aecb49556a39e4970cc469a (diff)
downloadframeworks_native-e3bc02347197a49aa061084073bde9fbea90cb80.zip
frameworks_native-e3bc02347197a49aa061084073bde9fbea90cb80.tar.gz
frameworks_native-e3bc02347197a49aa061084073bde9fbea90cb80.tar.bz2
keystore: add AID_ROOT into the user table.
Change-Id: I4b9cf24d75ca79583d7913bbb2c33745a2316cde
Diffstat (limited to 'cmds/keystore/keystore.c')
-rw-r--r--cmds/keystore/keystore.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/cmds/keystore/keystore.c b/cmds/keystore/keystore.c
index 4426874..60cc521 100644
--- a/cmds/keystore/keystore.c
+++ b/cmds/keystore/keystore.c
@@ -46,7 +46,7 @@
* user-defined password. To keep things simple, buffers are always larger than
* the maximum space we needed, so boundary checks on buffers are omitted. */
-#define KEY_SIZE 120
+#define KEY_SIZE ((NAME_MAX - 15) / 2)
#define VALUE_SIZE 32768
#define PASSWORD_SIZE VALUE_SIZE
@@ -442,10 +442,11 @@ static struct user {
uid_t euid;
uint32_t perms;
} users[] = {
- {AID_SYSTEM, 0, ~GET},
+ {AID_SYSTEM, ~0, ~GET},
{AID_VPN, AID_SYSTEM, GET},
{AID_WIFI, AID_SYSTEM, GET},
- {0, 0, TEST | GET | INSERT | DELETE | EXIST | SAW},
+ {AID_ROOT, AID_SYSTEM, GET},
+ {~0, ~0, TEST | GET | INSERT | DELETE | EXIST | SAW},
};
static int8_t process(int8_t code) {
@@ -453,7 +454,7 @@ static int8_t process(int8_t code) {
struct action *action = actions;
int i;
- while (user->uid && user->uid != uid) {
+ while (~user->uid && user->uid != uid) {
++user;
}
while (action->code && action->code != code) {
@@ -468,7 +469,7 @@ static int8_t process(int8_t code) {
if (action->state && action->state != state) {
return state;
}
- if (user->euid) {
+ if (~user->euid) {
uid = user->euid;
}
for (i = 0; i < MAX_PARAM && action->lengths[i]; ++i) {