summaryrefslogtreecommitdiffstats
path: root/partition.cpp
diff options
context:
space:
mode:
authorbigbiff bigbiff <bigbiff@teamw.in>2014-01-06 00:13:43 +0100
committerbigbiff bigbiff <bigbiff@teamw.in>2014-02-07 01:56:25 +0100
commit6b600f964471cef977821689185db687f67d2c19 (patch)
tree37f0383b94fa5052b9c060f4078ad539bc3110a0 /partition.cpp
parentDisable alpha blending for non-transparent bitmaps (diff)
downloadandroid_bootable_recovery-6b600f964471cef977821689185db687f67d2c19.tar
android_bootable_recovery-6b600f964471cef977821689185db687f67d2c19.tar.gz
android_bootable_recovery-6b600f964471cef977821689185db687f67d2c19.tar.bz2
android_bootable_recovery-6b600f964471cef977821689185db687f67d2c19.tar.lz
android_bootable_recovery-6b600f964471cef977821689185db687f67d2c19.tar.xz
android_bootable_recovery-6b600f964471cef977821689185db687f67d2c19.tar.zst
android_bootable_recovery-6b600f964471cef977821689185db687f67d2c19.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);
}
}