summaryrefslogtreecommitdiffstats
path: root/twrpTar.cpp
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 /twrpTar.cpp
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--twrpTar.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/twrpTar.cpp b/twrpTar.cpp
index 5a9340a25..9c151b939 100644
--- a/twrpTar.cpp
+++ b/twrpTar.cpp
@@ -860,10 +860,10 @@ void* twrpTar::extractMulti(void *cookie) {
int twrpTar::addFilesToExistingTar(vector <string> files, string fn) {
char* charTarFile = (char*) fn.c_str();
- if (tar_open(&t, charTarFile, NULL, O_RDONLY | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU) == -1)
+ if (tar_open(&t, charTarFile, NULL, O_RDONLY | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU | TAR_STORE_SELINUX) == -1)
return -1;
removeEOT(charTarFile);
- if (tar_open(&t, charTarFile, NULL, O_WRONLY | O_APPEND | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU) == -1)
+ if (tar_open(&t, charTarFile, NULL, O_WRONLY | O_APPEND | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU | TAR_STORE_SELINUX) == -1)
return -1;
for (unsigned int i = 0; i < files.size(); ++i) {
char* file = (char*) files.at(i).c_str();
@@ -956,7 +956,7 @@ int twrpTar::createTar() {
close(pipes[2]);
close(pipes[3]);
fd = pipes[1];
- if(tar_fdopen(&t, fd, charRootDir, NULL, O_WRONLY | O_CREAT | O_EXCL | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU) != 0) {
+ if(tar_fdopen(&t, fd, charRootDir, NULL, O_WRONLY | O_CREAT | O_EXCL | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU | TAR_STORE_SELINUX) != 0) {
close(fd);
LOGERR("tar_fdopen failed\n");
return -1;
@@ -1002,7 +1002,7 @@ int twrpTar::createTar() {
// Parent
close(pigzfd[0]); // close parent input
fd = pigzfd[1]; // copy parent output
- if(tar_fdopen(&t, fd, charRootDir, NULL, O_WRONLY | O_CREAT | O_EXCL | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU) != 0) {
+ if(tar_fdopen(&t, fd, charRootDir, NULL, O_WRONLY | O_CREAT | O_EXCL | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU | TAR_STORE_SELINUX) != 0) {
close(fd);
LOGERR("tar_fdopen failed\n");
return -1;
@@ -1042,7 +1042,7 @@ int twrpTar::createTar() {
// Parent
close(oaesfd[0]); // close parent input
fd = oaesfd[1]; // copy parent output
- if(tar_fdopen(&t, fd, charRootDir, NULL, O_WRONLY | O_CREAT | O_EXCL | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU) != 0) {
+ if(tar_fdopen(&t, fd, charRootDir, NULL, O_WRONLY | O_CREAT | O_EXCL | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU | TAR_STORE_SELINUX) != 0) {
close(fd);
LOGERR("tar_fdopen failed\n");
return -1;
@@ -1052,7 +1052,7 @@ int twrpTar::createTar() {
} else {
// Not compressed or encrypted
init_libtar_buffer(0);
- if (tar_open(&t, charTarFile, &type, O_WRONLY | O_CREAT | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU) == -1) {
+ if (tar_open(&t, charTarFile, &type, O_WRONLY | O_CREAT | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU | TAR_STORE_SELINUX) == -1) {
LOGERR("tar_open error opening '%s'\n", tarfn.c_str());
return -1;
}
@@ -1135,7 +1135,7 @@ int twrpTar::openTar() {
close(pipes[1]);
close(pipes[3]);
fd = pipes[2];
- if(tar_fdopen(&t, fd, charRootDir, NULL, O_RDONLY | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU) != 0) {
+ if(tar_fdopen(&t, fd, charRootDir, NULL, O_RDONLY | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU | TAR_STORE_SELINUX) != 0) {
close(fd);
LOGERR("tar_fdopen failed\n");
return -1;
@@ -1176,7 +1176,7 @@ int twrpTar::openTar() {
// Parent
close(oaesfd[1]); // close parent output
fd = oaesfd[0]; // copy parent input
- if(tar_fdopen(&t, fd, charRootDir, NULL, O_RDONLY | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU) != 0) {
+ if(tar_fdopen(&t, fd, charRootDir, NULL, O_RDONLY | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU | TAR_STORE_SELINUX) != 0) {
close(fd);
LOGERR("tar_fdopen failed\n");
return -1;
@@ -1213,13 +1213,13 @@ int twrpTar::openTar() {
// Parent
close(pigzfd[1]); // close parent output
fd = pigzfd[0]; // copy parent input
- if(tar_fdopen(&t, fd, charRootDir, NULL, O_RDONLY | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU) != 0) {
+ if(tar_fdopen(&t, fd, charRootDir, NULL, O_RDONLY | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU | TAR_STORE_SELINUX) != 0) {
close(fd);
LOGERR("tar_fdopen failed\n");
return -1;
}
}
- } else if (tar_open(&t, charTarFile, NULL, O_RDONLY | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU) != 0) {
+ } else if (tar_open(&t, charTarFile, NULL, O_RDONLY | O_LARGEFILE, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, TAR_GNU | TAR_STORE_SELINUX) != 0) {
LOGERR("Unable to open tar archive '%s'\n", charTarFile);
return -1;
}