summaryrefslogtreecommitdiffstats
path: root/cmds/servicemanager/service_manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmds/servicemanager/service_manager.c')
-rw-r--r--cmds/servicemanager/service_manager.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmds/servicemanager/service_manager.c b/cmds/servicemanager/service_manager.c
index a2006c1..01cddc6 100644
--- a/cmds/servicemanager/service_manager.c
+++ b/cmds/servicemanager/service_manager.c
@@ -193,6 +193,7 @@ int svcmgr_handler(struct binder_state *bs,
uint16_t *s;
unsigned len;
void *ptr;
+ uint32_t strict_policy;
// LOGI("target=%p code=%d pid=%d uid=%d\n",
// txn->target, txn->code, txn->sender_pid, txn->sender_euid);
@@ -200,8 +201,12 @@ int svcmgr_handler(struct binder_state *bs,
if (txn->target != svcmgr_handle)
return -1;
+ // Equivalent to Parcel::enforceInterface(), reading the RPC
+ // header with the strict mode policy mask and the interface name.
+ // Note that we ignore the strict_policy and don't propagate it
+ // further (since we do no outbound RPCs anyway).
+ strict_policy = bio_get_uint32(msg);
s = bio_get_string16(msg, &len);
-
if ((len != (sizeof(svcmgr_id) / 2)) ||
memcmp(svcmgr_id, s, sizeof(svcmgr_id))) {
fprintf(stderr,"invalid id %s\n", str8(s));