aboutsummaryrefslogtreecommitdiff
path: root/lib/tar
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-24 12:35:35 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-24 13:46:05 +0200
commit30fbd496a1793b4374873144432f9b7a996a689d (patch)
tree3112554b3c51501ca78b417569003b9f5a065fa0 /lib/tar
parent802b43c95ab4d6e44e17d6b81931e0963182c262 (diff)
cleanup: remove atime/ctime processing code
This commit removes all the code for parsing and processing atime/ctime and values and related test code. Caring about those is kind of pointless because squashfs can only store mtime in inodes. The only relevant place is when generating a struct stat from a squashfs inode or an fstree node. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/tar')
-rw-r--r--lib/tar/internal.h2
-rw-r--r--lib/tar/read_header.c62
2 files changed, 0 insertions, 64 deletions
diff --git a/lib/tar/internal.h b/lib/tar/internal.h
index 8a3a9c5..6ac8d99 100644
--- a/lib/tar/internal.h
+++ b/lib/tar/internal.h
@@ -21,9 +21,7 @@ enum {
PAX_DEV_MIN = 0x010,
PAX_NAME = 0x020,
PAX_SLINK_TARGET = 0x040,
- PAX_ATIME = 0x080,
PAX_MTIME = 0x100,
- PAX_CTIME = 0x200,
PAX_SPARSE_SIZE = 0x400,
};
diff --git a/lib/tar/read_header.c b/lib/tar/read_header.c
index 4843bb5..043b5ff 100644
--- a/lib/tar/read_header.c
+++ b/lib/tar/read_header.c
@@ -125,17 +125,6 @@ static int read_pax_header(int fd, uint64_t entsize, unsigned int *set_by_pax,
if (out->link_target == NULL)
goto fail_errno;
*set_by_pax |= PAX_SLINK_TARGET;
- } else if (!strncmp(line, "atime=", 6)) {
- if (line[6] == '-') {
- if (pax_read_decimal(line + 7, &field))
- goto fail;
- out->sb.st_atime = -((int64_t)field);
- } else {
- if (pax_read_decimal(line + 6, &field))
- goto fail;
- out->sb.st_atime = field;
- }
- *set_by_pax |= PAX_ATIME;
} else if (!strncmp(line, "mtime=", 6)) {
if (line[6] == '-') {
if (pax_read_decimal(line + 7, &field))
@@ -147,17 +136,6 @@ static int read_pax_header(int fd, uint64_t entsize, unsigned int *set_by_pax,
out->sb.st_mtime = field;
}
*set_by_pax |= PAX_MTIME;
- } else if (!strncmp(line, "ctime=", 6)) {
- if (line[6] == '-') {
- if (pax_read_decimal(line + 7, &field))
- goto fail;
- out->sb.st_ctime = -((int64_t)field);
- } else {
- if (pax_read_decimal(line + 6, &field))
- goto fail;
- out->sb.st_ctime = field;
- }
- *set_by_pax |= PAX_CTIME;
} else if (!strncmp(line, "GNU.sparse.name=", 16)) {
free(out->name);
out->name = strdup(line + 5);
@@ -312,46 +290,6 @@ static int decode_header(const tar_header_t *hdr, unsigned int set_by_pax,
}
}
- if (!(set_by_pax & PAX_ATIME)) {
- field = out->sb.st_mtime;
-
- if (version == ETV_PRE_POSIX &&
- ((uint8_t)hdr->tail.gnu.atime[0] == 0x80 ||
- (uint8_t)hdr->tail.gnu.atime[0] == 0xFF ||
- isdigit(hdr->tail.gnu.atime[0]))) {
- if (read_number(hdr->tail.gnu.atime,
- sizeof(hdr->tail.gnu.atime), &field))
- return -1;
- }
-
- if (field & 0x8000000000000000UL) {
- field = ~field + 1;
- out->sb.st_atime = -((int64_t)field);
- } else {
- out->sb.st_atime = field;
- }
- }
-
- if (!(set_by_pax & PAX_CTIME)) {
- field = out->sb.st_mtime;
-
- if (version == ETV_PRE_POSIX &&
- ((uint8_t)hdr->tail.gnu.ctime[0] == 0x80 ||
- (uint8_t)hdr->tail.gnu.ctime[0] == 0xFF ||
- isdigit(hdr->tail.gnu.ctime[0]))) {
- if (read_number(hdr->tail.gnu.ctime,
- sizeof(hdr->tail.gnu.atime), &field))
- return -1;
- }
-
- if (field & 0x8000000000000000UL) {
- field = ~field + 1;
- out->sb.st_ctime = -((int64_t)field);
- } else {
- out->sb.st_ctime = field;
- }
- }
-
if (read_octal(hdr->mode, sizeof(hdr->mode), &field))
return -1;