diff options
| author | Brad Fitzpatrick <bradfitz@android.com> | 2010-06-18 13:07:53 -0700 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@android.com> | 2010-06-21 12:56:35 -0700 |
| commit | 27b3a7a75960d026655f3acd1de8a672e80a5776 (patch) | |
| tree | cc5036a00b976b7757f26212abf49ed11f779cd9 /cmds/servicemanager/service_manager.c | |
| parent | f25c560dcdc0c04e11152fff11f521dae03522cd (diff) | |
| download | frameworks_base-27b3a7a75960d026655f3acd1de8a672e80a5776.zip frameworks_base-27b3a7a75960d026655f3acd1de8a672e80a5776.tar.gz frameworks_base-27b3a7a75960d026655f3acd1de8a672e80a5776.tar.bz2 | |
Start of work on passing around StrictMode policy over Binder calls.
This is (intendend to be) a no-op change.
At this stage, Binder RPCs just have an additional uint32 passed around
in the header, right before the interface name. But nothing is actually
done with them yet. That value should right now always be 0.
This now boots and seems to work.
Change-Id: I135b7c84f07575e6b9717fef2424d301a450df7b
Diffstat (limited to 'cmds/servicemanager/service_manager.c')
| -rw-r--r-- | cmds/servicemanager/service_manager.c | 7 |
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)); |
