summaryrefslogtreecommitdiffstats
path: root/libtar/append.c
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2017-02-03 21:26:15 +0100
committerEthan Yonker <dees_troy@teamw.in>2017-02-17 04:50:05 +0100
commit8d039f7bd84ce8cbbbe9ba5677f5a353d6224b66 (patch)
tree9cc3826e4e5e84f5ed7046eb7f804221bf0ab6f2 /libtar/append.c
parentPartition: Remove unused has_data_media variable (diff)
downloadandroid_bootable_recovery-8d039f7bd84ce8cbbbe9ba5677f5a353d6224b66.tar
android_bootable_recovery-8d039f7bd84ce8cbbbe9ba5677f5a353d6224b66.tar.gz
android_bootable_recovery-8d039f7bd84ce8cbbbe9ba5677f5a353d6224b66.tar.bz2
android_bootable_recovery-8d039f7bd84ce8cbbbe9ba5677f5a353d6224b66.tar.lz
android_bootable_recovery-8d039f7bd84ce8cbbbe9ba5677f5a353d6224b66.tar.xz
android_bootable_recovery-8d039f7bd84ce8cbbbe9ba5677f5a353d6224b66.tar.zst
android_bootable_recovery-8d039f7bd84ce8cbbbe9ba5677f5a353d6224b66.zip
Diffstat (limited to '')
-rw-r--r--libtar/append.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/libtar/append.c b/libtar/append.c
index d8ba3cad5..8896764f2 100644
--- a/libtar/append.c
+++ b/libtar/append.c
@@ -40,6 +40,7 @@
#ifdef HAVE_EXT4_CRYPT
# include "ext4crypt_tar.h"
#endif
+#include "android_utils.h"
struct tar_dev
{
@@ -172,6 +173,32 @@ tar_append_file(TAR *t, const char *realname, const char *savename)
}
}
+ /* get android user.default xattr */
+ if (TH_ISDIR(t) && t->options & TAR_STORE_ANDROID_USER_XATTR)
+ {
+ if (getxattr(realname, "user.default", NULL, 0) >= 0)
+ {
+ t->th_buf.has_user_default = 1;
+#if 1 //def DEBUG
+ printf("storing xattr user.default\n");
+#endif
+ }
+ if (getxattr(realname, "user.inode_cache", NULL, 0) >= 0)
+ {
+ t->th_buf.has_user_cache = 1;
+#if 1 //def DEBUG
+ printf("storing xattr user.inode_cache\n");
+#endif
+ }
+ if (getxattr(realname, "user.inode_code_cache", NULL, 0) >= 0)
+ {
+ t->th_buf.has_user_code_cache = 1;
+#if 1 //def DEBUG
+ printf("storing xattr user.inode_code_cache\n");
+#endif
+ }
+ }
+
/* check if it's a hardlink */
#ifdef DEBUG
puts("tar_append_file(): checking inode cache for hardlink...");