diff options
author | Biswajit Paul <biswajitpaul@codeaurora.org> | 2014-10-02 18:40:35 -0700 |
---|---|---|
committer | Ricardo Cerqueira <ricardo@cyngn.com> | 2015-10-30 16:02:11 +0000 |
commit | ee3533d78501b868a10c58f029c30db57e409c83 (patch) | |
tree | e1c92ea9ec956bf5c8c6108e6557421ed89c9f42 | |
parent | 48aa5c52e330976db5c64e95880817dde647a32e (diff) | |
download | system_core-ee3533d78501b868a10c58f029c30db57e409c83.zip system_core-ee3533d78501b868a10c58f029c30db57e409c83.tar.gz system_core-ee3533d78501b868a10c58f029c30db57e409c83.tar.bz2 |
ueventd: Add bootdevice links support for selinux
Adding bootdevice support to define context on common symlink.
Change-Id: I25d7239614539d1ef2c9920e2c321824ee2c664b
-rw-r--r-- | init/devices.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/init/devices.cpp b/init/devices.cpp index 9151f06..ba82f4f 100644 --- a/init/devices.cpp +++ b/init/devices.cpp @@ -487,10 +487,10 @@ static char **get_block_device_symlinks(struct uevent *uevent) return NULL; } - char **links = (char**) malloc(sizeof(char *) * 4); + char **links = (char**) malloc(sizeof(char *) * 6); if (!links) return NULL; - memset(links, 0, sizeof(char *) * 4); + memset(links, 0, sizeof(char *) * 6); INFO("found %s device %s\n", type, device); @@ -505,6 +505,11 @@ static char **get_block_device_symlinks(struct uevent *uevent) link_num++; else links[link_num] = NULL; + if (asprintf(&links[link_num], "/dev/block/bootdevice/by-name/%s", p) > 0) + link_num++; + else + links[link_num] = NULL; + free(p); } @@ -513,6 +518,11 @@ static char **get_block_device_symlinks(struct uevent *uevent) link_num++; else links[link_num] = NULL; + + if (asprintf(&links[link_num], "/dev/block/bootdevice/by-num/p%d", uevent->partition_num) > 0) + link_num++; + else + links[link_num] = NULL; } slash = strrchr(uevent->path, '/'); |