summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2013-04-30 21:13:47 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-04-30 21:13:47 -0700
commit72b1ffd375b27143b9e8f7bfddc5904c34b3f0e1 (patch)
treefbc172bd71def996f9a7a156b0e7f36c1e6a9502
parent51ef5882e79d72b03400812a4f37c32a36c80ebc (diff)
parent803eda6a2dfcb50f61dd4a6a616e560a87453cb0 (diff)
downloadsystem_core-72b1ffd375b27143b9e8f7bfddc5904c34b3f0e1.zip
system_core-72b1ffd375b27143b9e8f7bfddc5904c34b3f0e1.tar.gz
system_core-72b1ffd375b27143b9e8f7bfddc5904c34b3f0e1.tar.bz2
am 803eda6a: am f69cc564: Merge "Update ueventd set the SELinux context on sysfs"
* commit '803eda6a2dfcb50f61dd4a6a616e560a87453cb0': 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);
+ }
+ }
}
}