summaryrefslogtreecommitdiffstats
path: root/libtar/extract.c
diff options
context:
space:
mode:
authorDees Troy <dees_troy@teamw.in>2014-02-07 19:44:16 +0100
committerGerrit Code Review <gerrit2@gerrit>2014-02-07 19:44:16 +0100
commita8aac9038f5399ec28ec739966330c379bbac4db (patch)
tree6325f248a289c19e0d217319996f9af3c1f60a6d /libtar/extract.c
parentMerge "Implement mouse cursor" into android-4.4 (diff)
parentRestore contexts when doing mkdierhier in libtar (diff)
downloadandroid_bootable_recovery-a8aac9038f5399ec28ec739966330c379bbac4db.tar
android_bootable_recovery-a8aac9038f5399ec28ec739966330c379bbac4db.tar.gz
android_bootable_recovery-a8aac9038f5399ec28ec739966330c379bbac4db.tar.bz2
android_bootable_recovery-a8aac9038f5399ec28ec739966330c379bbac4db.tar.lz
android_bootable_recovery-a8aac9038f5399ec28ec739966330c379bbac4db.tar.xz
android_bootable_recovery-a8aac9038f5399ec28ec739966330c379bbac4db.tar.zst
android_bootable_recovery-a8aac9038f5399ec28ec739966330c379bbac4db.zip
Diffstat (limited to '')
-rw-r--r--libtar/extract.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libtar/extract.c b/libtar/extract.c
index 8081aa2b9..d9ab7882f 100644
--- a/libtar/extract.c
+++ b/libtar/extract.c
@@ -159,11 +159,14 @@ tar_extract_file(TAR *t, char *realname, char *prefix)
if((t->options & TAR_STORE_SELINUX) && t->th_buf.selinux_context != NULL)
{
#ifdef DEBUG
- printf(" Restoring SELinux context %s to file %s\n", t->th_buf.selinux_context, realname);
+ printf(" Restoring SELinux context %s to file %s\n", t->th_buf.selinux_context, realname);
#endif
if (lsetfilecon(realname, t->th_buf.selinux_context) < 0) {
fprintf(stderr, "Failed to restore SELinux context %s!\n", strerror(errno));
}
+ if (lsetfilecon(dirname(realname), t->th_buf.selinux_context) < 0) {
+ fprintf(stderr, "Failed to restore SELinux context %s!\n", strerror(errno));
+ }
}
#endif