diff options
author | Mathias Agopian <mathias@google.com> | 2009-05-22 01:27:01 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-05-22 02:16:08 -0700 |
commit | 947f4f4d384ea26eb2145cc070a3eed42c59534a (patch) | |
tree | edc5fb1e6e808a2b809720f44b6236ebe93b577b /libs/ui/ISurfaceFlingerClient.cpp | |
parent | 6158b1bf0364da1582468a98ec09d004ba99deec (diff) | |
parent | 0690519fcde1ccb189081aa79df61436f65686c2 (diff) | |
download | frameworks_base-947f4f4d384ea26eb2145cc070a3eed42c59534a.zip frameworks_base-947f4f4d384ea26eb2145cc070a3eed42c59534a.tar.gz frameworks_base-947f4f4d384ea26eb2145cc070a3eed42c59534a.tar.bz2 |
merge master to master_gl
Diffstat (limited to 'libs/ui/ISurfaceFlingerClient.cpp')
-rw-r--r-- | libs/ui/ISurfaceFlingerClient.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/libs/ui/ISurfaceFlingerClient.cpp b/libs/ui/ISurfaceFlingerClient.cpp index 597b87e..c2f6f83 100644 --- a/libs/ui/ISurfaceFlingerClient.cpp +++ b/libs/ui/ISurfaceFlingerClient.cpp @@ -21,10 +21,10 @@ #include <stdint.h> #include <sys/types.h> -#include <utils/Parcel.h> -#include <utils/IMemory.h> -#include <utils/IPCThreadState.h> -#include <utils/IServiceManager.h> +#include <binder/Parcel.h> +#include <binder/IMemory.h> +#include <binder/IPCThreadState.h> +#include <binder/IServiceManager.h> #include <ui/ISurface.h> #include <ui/ISurfaceFlingerClient.h> @@ -35,6 +35,13 @@ // --------------------------------------------------------------------------- +/* ideally AID_GRAPHICS would be in a semi-public header + * or there would be a way to map a user/group name to its id + */ +#ifndef AID_GRAPHICS +#define AID_GRAPHICS 1003 +#endif + #define LIKELY( exp ) (__builtin_expect( (exp) != 0, true )) #define UNLIKELY( exp ) (__builtin_expect( (exp) != 0, false )) @@ -136,13 +143,13 @@ status_t BnSurfaceFlingerClient::onTransact( IPCThreadState* ipc = IPCThreadState::self(); const int pid = ipc->getCallingPid(); - const int self_pid = getpid(); - if (UNLIKELY(pid != self_pid)) { + const int uid = ipc->getCallingUid(); + const int self_pid = getpid(); + if (UNLIKELY(pid != self_pid && uid != AID_GRAPHICS)) { // we're called from a different process, do the real check if (!checkCallingPermission( String16("android.permission.ACCESS_SURFACE_FLINGER"))) { - const int uid = ipc->getCallingUid(); LOGE("Permission Denial: " "can't openGlobalTransaction pid=%d, uid=%d", pid, uid); return PERMISSION_DENIED; |