summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2013-05-01 03:48:41 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-05-01 03:48:41 +0000
commitf69cc564f4129ad7f223bb7d83ebec9fe3438b62 (patch)
tree0cc8853ac335bc21ef3d713ff50544e4448ce60e
parent032be7a4c5be8c015063084d162d1f394279aa3d (diff)
parent5f7b017f41b5bd0b86b5078b17c41ef7bc201c8d (diff)
downloadsystem_core-f69cc564f4129ad7f223bb7d83ebec9fe3438b62.zip
system_core-f69cc564f4129ad7f223bb7d83ebec9fe3438b62.tar.gz
system_core-f69cc564f4129ad7f223bb7d83ebec9fe3438b62.tar.bz2
Merge "Update ueventd set the SELinux context on sysfs"
-rw-r--r--init/devices.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/init/devices.c b/init/devices.c
index e25034c..69f5fc8 100644
--- a/init/devices.c
+++ b/init/devices.c
@@ -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);
+ }
+ }
}
}