Merge "Improving maps output."
diff --git a/init/devices.c b/init/devices.c
index 58b2704..e27c311 100644
--- a/init/devices.c
+++ b/init/devices.c
@@ -134,11 +134,10 @@
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...
- */
+ /* upaths omit the "/sys" that paths in this list
+ * contain, so we add 4 when comparing...
+ */
list_for_each(node, &sys_perms) {
dp = &(node_to_item(node, struct perm_node, plist))->dp;
if (dp->prefix) {
@@ -153,20 +152,23 @@
}
if ((strlen(upath) + strlen(dp->attr) + 6) > sizeof(buf))
- return;
+ break;
sprintf(buf,"/sys%s/%s", upath, dp->attr);
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);
- }
- }
+ }
+
+ // Now fixup SELinux file labels
+ int len = snprintf(buf, sizeof(buf), "/sys%s", upath);
+ if ((len < 0) || ((size_t) len >= sizeof(buf))) {
+ // Overflow
+ return;
+ }
+ if (access(buf, F_OK) == 0) {
+ INFO("restorecon_recursive: %s\n", buf);
+ restorecon_recursive(buf);
}
}
diff --git a/rootdir/init.rc b/rootdir/init.rc
index a2c9c0f..62598a0 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -276,8 +276,6 @@
mkdir /data/app-lib 0771 system system
mkdir /data/app 0771 system system
mkdir /data/property 0700 root root
- mkdir /data/ssh 0750 root shell
- mkdir /data/ssh/empty 0700 root root
# create dalvik-cache, so as to enforce our permissions
mkdir /data/dalvik-cache 0771 system system
@@ -609,10 +607,6 @@
disabled
oneshot
-service sshd /system/bin/start-ssh
- class main
- disabled
-
service mdnsd /system/bin/mdnsd
class main
user mdnsr