summaryrefslogtreecommitdiffstats
path: root/libtar/libtar.h
diff options
context:
space:
mode:
authorVojtech Bocek <vbocek@gmail.com>2013-08-27 03:10:10 +0200
committerVojtech Bocek <vbocek@gmail.com>2013-09-05 21:43:52 +0200
commit25fd68d0989254bdf921bcd118c4bae4d8afc419 (patch)
treeeb09b5a22aa0a5a2ff881547d769f042a74eebb0 /libtar/libtar.h
parentUpdate to latest AOSP master (diff)
downloadandroid_bootable_recovery-25fd68d0989254bdf921bcd118c4bae4d8afc419.tar
android_bootable_recovery-25fd68d0989254bdf921bcd118c4bae4d8afc419.tar.gz
android_bootable_recovery-25fd68d0989254bdf921bcd118c4bae4d8afc419.tar.bz2
android_bootable_recovery-25fd68d0989254bdf921bcd118c4bae4d8afc419.tar.lz
android_bootable_recovery-25fd68d0989254bdf921bcd118c4bae4d8afc419.tar.xz
android_bootable_recovery-25fd68d0989254bdf921bcd118c4bae4d8afc419.tar.zst
android_bootable_recovery-25fd68d0989254bdf921bcd118c4bae4d8afc419.zip
Diffstat (limited to '')
-rw-r--r--libtar/libtar.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libtar/libtar.h b/libtar/libtar.h
index e7a355a85..91523d043 100644
--- a/libtar/libtar.h
+++ b/libtar/libtar.h
@@ -35,6 +35,9 @@ extern "C"
#define GNU_LONGNAME_TYPE 'L'
#define GNU_LONGLINK_TYPE 'K'
+/* extended metadata for next file - used to store selinux_context */
+#define TH_EXT_TYPE 'x'
+
/* our version of the tar header structure */
struct tar_header
{
@@ -57,6 +60,9 @@ struct tar_header
char padding[12];
char *gnu_longname;
char *gnu_longlink;
+#ifdef HAVE_SELINUX
+ char *selinux_context;
+#endif
};
@@ -96,6 +102,7 @@ TAR;
#define TAR_CHECK_MAGIC 16 /* check magic in file header */
#define TAR_CHECK_VERSION 32 /* check version in file header */
#define TAR_IGNORE_CRC 64 /* ignore CRC in file header */
+#define TAR_STORE_SELINUX 128 /* store selinux context */
/* this is obsolete - it's here for backwards-compatibility only */
#define TAR_IGNORE_MAGIC 0
@@ -177,6 +184,7 @@ int th_write(TAR *t);
|| S_ISFIFO((mode_t)oct_to_int((t)->th_buf.mode)))
#define TH_ISLONGNAME(t) ((t)->th_buf.typeflag == GNU_LONGNAME_TYPE)
#define TH_ISLONGLINK(t) ((t)->th_buf.typeflag == GNU_LONGLINK_TYPE)
+#define TH_ISEXTHEADER(t) ((t)->th_buf.typeflag == TH_EXT_TYPE)
/* decode tar header info */
#define th_get_crc(t) oct_to_int((t)->th_buf.chksum)