summaryrefslogtreecommitdiffstats
path: root/partition.cpp
diff options
context:
space:
mode:
authorDees Troy <dees_troy@teamw.in>2014-02-07 19:44:16 +0100
committerGerrit Code Review <gerrit2@gerrit>2014-02-07 19:44:16 +0100
commita8aac9038f5399ec28ec739966330c379bbac4db (patch)
tree6325f248a289c19e0d217319996f9af3c1f60a6d /partition.cpp
parentMerge "Implement mouse cursor" into android-4.4 (diff)
parentRestore contexts when doing mkdierhier in libtar (diff)
downloadandroid_bootable_recovery-a8aac9038f5399ec28ec739966330c379bbac4db.tar
android_bootable_recovery-a8aac9038f5399ec28ec739966330c379bbac4db.tar.gz
android_bootable_recovery-a8aac9038f5399ec28ec739966330c379bbac4db.tar.bz2
android_bootable_recovery-a8aac9038f5399ec28ec739966330c379bbac4db.tar.lz
android_bootable_recovery-a8aac9038f5399ec28ec739966330c379bbac4db.tar.xz
android_bootable_recovery-a8aac9038f5399ec28ec739966330c379bbac4db.tar.zst
android_bootable_recovery-a8aac9038f5399ec28ec739966330c379bbac4db.zip
Diffstat (limited to 'partition.cpp')
-rw-r--r--partition.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/partition.cpp b/partition.cpp
index 95f6bcac4..974f7e4a5 100644
--- a/partition.cpp
+++ b/partition.cpp
@@ -40,6 +40,7 @@
#include "twrpDigest.hpp"
#include "twrpTar.hpp"
#include "twrpDU.hpp"
+#include "fixPermissions.hpp"
extern "C" {
#include "mtdutils/mtdutils.h"
#include "mtdutils/mounts.h"
@@ -1511,6 +1512,9 @@ bool TWPartition::Wipe_F2FS() {
bool TWPartition::Wipe_Data_Without_Wiping_Media() {
string dir;
+ #ifdef HAVE_SELINUX
+ fixPermissions perms;
+ #endif
// This handles wiping data on devices with "sdcard" in /data/media
if (!Mount(true))
@@ -1541,6 +1545,10 @@ bool TWPartition::Wipe_Data_Without_Wiping_Media() {
}
closedir(d);
+ #ifdef HAVE_SELINUX
+ perms.fixDataInternalContexts();
+ #endif
+
gui_print("Done.\n");
return true;
}
@@ -1811,12 +1819,19 @@ void TWPartition::Find_Actual_Block_Device(void) {
void TWPartition::Recreate_Media_Folder(void) {
string Command;
+ #ifdef HAVE_SELINUX
+ fixPermissions perms;
+ #endif
+
if (!Mount(true)) {
LOGERR("Unable to recreate /data/media folder.\n");
} else if (!TWFunc::Path_Exists("/data/media")) {
PartitionManager.Mount_By_Path(Symlink_Mount_Point, true);
LOGINFO("Recreating /data/media folder.\n");
mkdir("/data/media", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
+ #ifdef HAVE_SELINUX
+ perms.fixDataInternalContexts();
+ #endif
PartitionManager.UnMount_By_Path(Symlink_Mount_Point, true);
}
}