fix getting and setting contexts in selinux

recreate lost+found with selinux contexts

Change-Id: I19e8696d47319dfb641520956c8a27c2a796a0c3
This commit is contained in:
bigbiff bigbiff
2013-10-11 20:28:00 -04:00
committed by Dees Troy
parent fb9f7f3c7f
commit d0c24c50d9
6 changed files with 31 additions and 16 deletions
+9
View File
@@ -53,6 +53,9 @@ extern "C" {
#include "make_ext4fs.h"
#endif
}
#ifdef HAVE_SELINUX
#include "selinux/selinux.h"
#endif
using namespace std;
@@ -1272,6 +1275,12 @@ bool TWPartition::Wipe_EXT4() {
LOGERR("Unable to wipe '%s' using function call.\n", Mount_Point.c_str());
return false;
} else {
#ifdef HAVE_SELINUX
string sedir = Mount_Point + "/lost+found";
PartitionManager.Mount_By_Path(sedir.c_str(), true);
rmdir(sedir.c_str());
mkdir(sedir.c_str(), S_IRWXU | S_IRWXG | S_IWGRP | S_IXGRP);
#endif
return true;
}
#else