Merge "Replace security_context_t type" am: 530329222f

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1824052

Change-Id: Ie3c20ee9187f349c308798ec370f7aa754fdfa85
diff --git a/Utils.cpp b/Utils.cpp
index 4635975..f9f3058 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -68,10 +68,10 @@
 namespace android {
 namespace vold {
 
-security_context_t sBlkidContext = nullptr;
-security_context_t sBlkidUntrustedContext = nullptr;
-security_context_t sFsckContext = nullptr;
-security_context_t sFsckUntrustedContext = nullptr;
+char* sBlkidContext = nullptr;
+char* sBlkidUntrustedContext = nullptr;
+char* sFsckContext = nullptr;
+char* sFsckUntrustedContext = nullptr;
 
 bool sSleepOnUnmount = true;
 
@@ -702,7 +702,7 @@
 }
 
 status_t ForkExecvp(const std::vector<std::string>& args, std::vector<std::string>* output,
-                    security_context_t context) {
+                    char* context) {
     auto argv = ConvertToArgv(args);
 
     android::base::unique_fd pipe_read, pipe_write;
diff --git a/Utils.h b/Utils.h
index a3316c3..bb6615c 100644
--- a/Utils.h
+++ b/Utils.h
@@ -38,10 +38,10 @@
 static const char* kExternalStorageSdcardfs = "external_storage.sdcardfs.enabled";
 
 /* SELinux contexts used depending on the block device type */
-extern security_context_t sBlkidContext;
-extern security_context_t sBlkidUntrustedContext;
-extern security_context_t sFsckContext;
-extern security_context_t sFsckUntrustedContext;
+extern char* sBlkidContext;
+extern char* sBlkidUntrustedContext;
+extern char* sFsckContext;
+extern char* sFsckUntrustedContext;
 
 // TODO remove this with better solution, b/64143519
 extern bool sSleepOnUnmount;
@@ -104,8 +104,8 @@
                                std::string* fsLabel);
 
 /* Returns either WEXITSTATUS() status, or a negative errno */
-status_t ForkExecvp(const std::vector<std::string>& args, std::vector<std::string>* output = nullptr,
-                    security_context_t context = nullptr);
+status_t ForkExecvp(const std::vector<std::string>& args,
+                    std::vector<std::string>* output = nullptr, char* context = nullptr);
 
 pid_t ForkExecvpAsync(const std::vector<std::string>& args);