From f4766921d4865c71c5f93b6bcc45527172934446 Mon Sep 17 00:00:00 2001 From: Dees Troy Date: Wed, 9 Oct 2013 14:45:24 +0000 Subject: Ensure root folders get added in split archives Make sure that we add the root folder itself to get the perms and SELinux contexts before splitting to a second archive. Change-Id: Id93a9f9b4767b61bba38eb0cf7306c81a8540a3c --- twrpTar.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/twrpTar.cpp b/twrpTar.cpp index 534049f97..eba482ee7 100644 --- a/twrpTar.cpp +++ b/twrpTar.cpp @@ -537,6 +537,12 @@ int twrpTar::Generate_Multiple_Archives(string Path) { { unsigned long long folder_size = TWFunc::Get_Folder_Size(FileName, false); if (Archive_Current_Size + folder_size > MAX_ARCHIVE_SIZE) { + // Add the root folder first + LOGINFO("Adding root folder '%s' before splitting.\n", FileName.c_str()); + if (addFile(FileName, true) != 0) { + LOGERR("Error adding folder '%s' to split archive.\n", FileName.c_str()); + return -1; + } LOGINFO("Calling Generate_Multiple_Archives\n"); if (Generate_Multiple_Archives(FileName) < 0) return -1; -- cgit v1.2.3