summaryrefslogtreecommitdiffstats
path: root/libtar/append.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtar/append.c')
-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...");