summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2014-10-24 19:52:40 +0200
committerAndroid Git Automerger <android-git-automerger@android.com>2014-10-24 19:52:40 +0200
commit944fc5e616b6f70da3447fc6987fb2f92dfdc01f (patch)
tree0f88303e37cf0900eb13ff318fa7b49eb525aeed
parentam da500cec: am 168f7778: Allow passing of mount args to mountFn (diff)
parentam 68802416: unconditionally apply SELinux labels to symlinks (diff)
downloadandroid_bootable_recovery-944fc5e616b6f70da3447fc6987fb2f92dfdc01f.tar
android_bootable_recovery-944fc5e616b6f70da3447fc6987fb2f92dfdc01f.tar.gz
android_bootable_recovery-944fc5e616b6f70da3447fc6987fb2f92dfdc01f.tar.bz2
android_bootable_recovery-944fc5e616b6f70da3447fc6987fb2f92dfdc01f.tar.lz
android_bootable_recovery-944fc5e616b6f70da3447fc6987fb2f92dfdc01f.tar.xz
android_bootable_recovery-944fc5e616b6f70da3447fc6987fb2f92dfdc01f.tar.zst
android_bootable_recovery-944fc5e616b6f70da3447fc6987fb2f92dfdc01f.zip
Diffstat (limited to '')
-rw-r--r--updater/install.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/updater/install.c b/updater/install.c
index 282a6188b..db2bd3295 100644
--- a/updater/install.c
+++ b/updater/install.c
@@ -770,9 +770,17 @@ static int ApplyParsedPerms(
{
int bad = 0;
+ if (parsed.has_selabel) {
+ if (lsetfilecon(filename, parsed.selabel) != 0) {
+ uiPrintf(state, "ApplyParsedPerms: lsetfilecon of %s to %s failed: %s\n",
+ filename, parsed.selabel, strerror(errno));
+ bad++;
+ }
+ }
+
/* ignore symlinks */
if (S_ISLNK(statptr->st_mode)) {
- return 0;
+ return bad;
}
if (parsed.has_uid) {
@@ -815,15 +823,6 @@ static int ApplyParsedPerms(
}
}
- if (parsed.has_selabel) {
- // TODO: Don't silently ignore ENOTSUP
- if (lsetfilecon(filename, parsed.selabel) && (errno != ENOTSUP)) {
- uiPrintf(state, "ApplyParsedPerms: lsetfilecon of %s to %s failed: %s\n",
- filename, parsed.selabel, strerror(errno));
- bad++;
- }
- }
-
if (parsed.has_capabilities && S_ISREG(statptr->st_mode)) {
if (parsed.capabilities == 0) {
if ((removexattr(filename, XATTR_NAME_CAPS) == -1) && (errno != ENODATA)) {