summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-08-16 19:11:15 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-08-16 19:11:15 +0000
commitee46f57bb2b3a03d764eb1fd74ea44a26a89d937 (patch)
treeececa7e31eba55081d77293f8e4a77d1fcead7cc
parentd1fe77fd4d8ded10fa143050c1927fca7f0ffbe0 (diff)
parent2779ff22e2c6c9e0abda85efac80dcf8c466bfda (diff)
Merge "android_os_SELinux.cpp: fix deprecation warnings." into main
-rw-r--r--core/jni/android_os_SELinux.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/jni/android_os_SELinux.cpp b/core/jni/android_os_SELinux.cpp
index 84ca1ba6ad7c..7a4670f4e49d 100644
--- a/core/jni/android_os_SELinux.cpp
+++ b/core/jni/android_os_SELinux.cpp
@@ -53,7 +53,7 @@ selabel_handle* GetSELabelHandle() {
}
struct SecurityContext_Delete {
- void operator()(security_context_t p) const {
+ void operator()(char* p) const {
freecon(p);
}
};
@@ -111,7 +111,7 @@ static jstring fileSelabelLookup(JNIEnv* env, jobject, jstring pathStr) {
return NULL;
}
- security_context_t tmp = NULL;
+ char* tmp = NULL;
if (selabel_lookup(selabel_handle, &tmp, path_c_str, S_IFREG) != 0) {
ALOGE("fileSelabelLookup => selabel_lookup for %s failed: %d", path_c_str, errno);
return NULL;
@@ -138,7 +138,7 @@ static jstring getFdConInner(JNIEnv *env, jobject fileDescriptor, bool isSocket)
return NULL;
}
- security_context_t tmp = NULL;
+ char* tmp = NULL;
int ret;
if (isSocket) {
ret = getpeercon(fd, &tmp);
@@ -184,7 +184,7 @@ static jstring getFdCon(JNIEnv *env, jobject, jobject fileDescriptor) {
* Function: setFSCreateCon
* Purpose: set security context used for creating a new file system object
* Parameters:
- * context: security_context_t representing the new context of a file system object,
+ * context: char* representing the new context of a file system object,
* set to NULL to return to the default policy behavior
* Returns: true on success, false on error
* Exception: none
@@ -267,7 +267,7 @@ static jstring getFileCon(JNIEnv *env, jobject, jstring pathStr) {
return NULL;
}
- security_context_t tmp = NULL;
+ char* tmp = NULL;
int ret = getfilecon(path.c_str(), &tmp);
Unique_SecurityContext context(tmp);
@@ -293,7 +293,7 @@ static jstring getCon(JNIEnv *env, jobject) {
return NULL;
}
- security_context_t tmp = NULL;
+ char* tmp = NULL;
int ret = getcon(&tmp);
Unique_SecurityContext context(tmp);
@@ -320,7 +320,7 @@ static jstring getPidCon(JNIEnv *env, jobject, jint pid) {
return NULL;
}
- security_context_t tmp = NULL;
+ char* tmp = NULL;
int ret = getpidcon(static_cast<pid_t>(pid), &tmp);
Unique_SecurityContext context(tmp);