Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f203e3d3 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Promotion of android-framework.lnx.2.0-00013.

CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
1065975   I38c6e8bc7f7cba1cbd3568e8fed1ae7ac2054a9b   ServiceManager: Restore basic uid check
1065975   I1b74d58be38ed358f43c163692f9e704f8f31dbe   ServiceManager: Allow system services running as seconda

Change-Id: I32be37c4e939a9c3aad573f62dd83bfd581d8ac0
CRs-Fixed: 1065975
parents 6ab69f0e 55a568b7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ LOCAL_MODULE_TAGS := optional
include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)
LOCAL_SHARED_LIBRARIES := liblog libselinux
LOCAL_SHARED_LIBRARIES := liblog libcutils libselinux
LOCAL_SRC_FILES := service_manager.c binder.c
LOCAL_CFLAGS += $(svc_c_flags)
LOCAL_MODULE := servicemanager
+7 −0
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@
#include <stdlib.h>
#include <string.h>

#include <cutils/multiuser.h>

#include <private/android_filesystem_config.h>

#include <selinux/android.h>
@@ -121,6 +123,11 @@ static bool check_mac_perms_from_lookup(pid_t spid, uid_t uid, const char *perm,
static int svc_can_register(const uint16_t *name, size_t name_len, pid_t spid, uid_t uid)
{
    const char *perm = "add";

    if (multiuser_get_app_id(uid) >= AID_APP) {
        return 0; /* Don't allow apps to register services */
    }

    return check_mac_perms_from_lookup(spid, uid, perm, str8(name, name_len)) ? 1 : 0;
}