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

Commit 72b1ffd3 authored by Colin Cross's avatar Colin Cross Committed by Android Git Automerger
Browse files

am 803eda6a: am f69cc564: Merge "Update ueventd set the SELinux context on sysfs"

* commit '803eda6a':
  Update ueventd set the SELinux context on sysfs
parents 51ef5882 803eda6a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ void fixup_sys_perms(const char *upath)
    char buf[512];
    struct listnode *node;
    struct perms_ *dp;
    char *secontext;

        /* upaths omit the "/sys" that paths in this list
         * contain, so we add 4 when comparing...
@@ -148,6 +149,14 @@ void fixup_sys_perms(const char *upath)
        INFO("fixup %s %d %d 0%o\n", buf, dp->uid, dp->gid, dp->perm);
        chown(buf, dp->uid, dp->gid);
        chmod(buf, dp->perm);
        if (sehandle) {
            secontext = NULL;
            selabel_lookup(sehandle, &secontext, buf, 0);
            if (secontext) {
                setfilecon(buf, secontext);
                freecon(secontext);
           }
        }
    }
}