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

Commit f8486765 authored by Arve Hjnnevg's avatar Arve Hjnnevg Committed by android-build-merger
Browse files

ServiceManager: Allow system services running as secondary users to add services

am: 6b9c6d23

Change-Id: I556897757f0a1d019bbf269e8e32644d346119ba
parents 362687f1 6b9c6d23
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -31,6 +31,6 @@ cc_binary {
        "service_manager.c",
        "service_manager.c",
        "binder.c",
        "binder.c",
    ],
    ],
    shared_libs: ["libselinux"],
    shared_libs: ["libcutils", "libselinux"],
    init_rc: ["servicemanager.rc"],
    init_rc: ["servicemanager.rc"],
}
}
+3 −1
Original line number Original line Diff line number Diff line
@@ -8,6 +8,8 @@
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>


#include <cutils/multiuser.h>

#include <private/android_filesystem_config.h>
#include <private/android_filesystem_config.h>


#include <selinux/android.h>
#include <selinux/android.h>
@@ -122,7 +124,7 @@ static int svc_can_register(const uint16_t *name, size_t name_len, pid_t spid, u
{
{
    const char *perm = "add";
    const char *perm = "add";


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