diff options
author | Nick Kralevich <nnk@google.com> | 2014-10-24 17:43:15 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-10-24 17:43:15 +0000 |
commit | 915d661ccc64f25a533919054f487a8e5943574d (patch) | |
tree | 5b661997431ff4cddfbd590046e418fad1f4b8fa /updater | |
parent | da500cecf5b004498c0dd17bc27a30eb4b0b9a2d (diff) | |
parent | 688024169df70336cc128ea8cc929174c53a501e (diff) | |
download | bootable_recovery-915d661ccc64f25a533919054f487a8e5943574d.zip bootable_recovery-915d661ccc64f25a533919054f487a8e5943574d.tar.gz bootable_recovery-915d661ccc64f25a533919054f487a8e5943574d.tar.bz2 |
am 68802416: unconditionally apply SELinux labels to symlinks
* commit '688024169df70336cc128ea8cc929174c53a501e':
unconditionally apply SELinux labels to symlinks
Diffstat (limited to 'updater')
-rw-r--r-- | updater/install.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/updater/install.c b/updater/install.c index 282a618..db2bd32 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)) { |