summaryrefslogtreecommitdiffstats
path: root/libtar/append.c
diff options
context:
space:
mode:
authorbigbiff bigbiff <bigbiff@teamw.in>2013-10-12 02:28:00 +0200
committerDees Troy <dees_troy@teamw.in>2013-10-17 18:49:49 +0200
commitc49d7069039241ad02a8a710e9054d253abee3ad (patch)
tree40d9a8e023ad47e9a4032d23b160770e4fcaa12d /libtar/append.c
parentMerge "Ensure root folders get added in split archives" into twrp2.7 (diff)
downloadandroid_bootable_recovery-c49d7069039241ad02a8a710e9054d253abee3ad.tar
android_bootable_recovery-c49d7069039241ad02a8a710e9054d253abee3ad.tar.gz
android_bootable_recovery-c49d7069039241ad02a8a710e9054d253abee3ad.tar.bz2
android_bootable_recovery-c49d7069039241ad02a8a710e9054d253abee3ad.tar.lz
android_bootable_recovery-c49d7069039241ad02a8a710e9054d253abee3ad.tar.xz
android_bootable_recovery-c49d7069039241ad02a8a710e9054d253abee3ad.tar.zst
android_bootable_recovery-c49d7069039241ad02a8a710e9054d253abee3ad.zip
Diffstat (limited to 'libtar/append.c')
-rw-r--r--libtar/append.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/libtar/append.c b/libtar/append.c
index 3a8bfc690..dcd864984 100644
--- a/libtar/append.c
+++ b/libtar/append.c
@@ -92,29 +92,22 @@ tar_append_file(TAR *t, char *realname, char *savename)
#ifdef HAVE_SELINUX
/* get selinux context */
- if(t->options & TAR_STORE_SELINUX)
- {
- if(t->th_buf.selinux_context != NULL)
- {
+ if(t->options & TAR_STORE_SELINUX) {
+ if(t->th_buf.selinux_context != NULL) {
free(t->th_buf.selinux_context);
t->th_buf.selinux_context = NULL;
}
security_context_t selinux_context = NULL;
- if(getfilecon(realname, &selinux_context) >= 0)
- {
+ if (lgetfilecon(realname, &selinux_context) >= 0) {
t->th_buf.selinux_context = strdup(selinux_context);
+ printf("setting selinux context: %s\n", selinux_context);
freecon(selinux_context);
}
else
- {
-#ifdef DEBUG
perror("Failed to get selinux context");
-#endif
- }
}
#endif
-
/* check if it's a hardlink */
#ifdef DEBUG
puts(" tar_append_file(): checking inode cache for hardlink...");