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

Commit 30f30330 authored by Stephen Smalley's avatar Stephen Smalley
Browse files

Label sockets consistently with the seclabel value if specified.



This is necessary to ensure that the adbd socket is created in the
adbd domain rather than the init domain.

Change-Id: Id4997d7f074aeefea62b41c87b46a6609e03f527
Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
parent 3ddc0059
Loading
Loading
Loading
Loading
+27 −19
Original line number Diff line number Diff line
@@ -198,6 +198,13 @@ void service_start(struct service *svc, const char *dynamic_args)
    }

    if (is_selinux_enabled() > 0) {
        if (svc->seclabel) {
            scon = strdup(svc->seclabel);
            if (!scon) {
                ERROR("Out of memory while starting '%s'\n", svc->name);
                return;
            }
        } else {
            char *mycon = NULL, *fcon = NULL;

            INFO("computing context for service '%s'\n", svc->args[0]);
@@ -222,6 +229,7 @@ void service_start(struct service *svc, const char *dynamic_args)
                return;
            }
        }
    }

    NOTICE("starting '%s'\n", svc->name);