b1b450
From 73006fb25f0ebc35bc46b8f20036d40fcbb6de53 Mon Sep 17 00:00:00 2001
b1b450
From: Radovan Sroka <rsroka@redhat.com>
b1b450
Date: Thu, 1 Apr 2021 21:42:03 +0200
b1b450
Subject: [PATCH] Removed depricated security_context_t
b1b450
b1b450
Signed-off-by: Radovan Sroka <rsroka@redhat.com>
b1b450
---
b1b450
 src/selinux.c | 24 ++++++++++++------------
b1b450
 1 file changed, 12 insertions(+), 12 deletions(-)
b1b450
b1b450
diff --git a/src/selinux.c b/src/selinux.c
b1b450
index a2f73f8d0..c2f50aafb 100644
b1b450
--- a/src/selinux.c
b1b450
+++ b/src/selinux.c
b1b450
@@ -58,10 +58,10 @@
b1b450
 #include "sudo_exec.h"
b1b450
 
b1b450
 static struct selinux_state {
b1b450
-    security_context_t old_context;
b1b450
-    security_context_t new_context;
b1b450
-    security_context_t tty_con_raw;
b1b450
-    security_context_t new_tty_con_raw;
b1b450
+    char * old_context;
b1b450
+    char * new_context;
b1b450
+    char * tty_con_raw;
b1b450
+    char * new_tty_con_raw;
b1b450
     const char *ttyn;
b1b450
     int ttyfd;
b1b450
     int enforcing;
b1b450
@@ -69,8 +69,8 @@ static struct selinux_state {
b1b450
 
b1b450
 #ifdef HAVE_LINUX_AUDIT
b1b450
 static int
b1b450
-audit_role_change(const security_context_t old_context,
b1b450
-    const security_context_t new_context, const char *ttyn, int result)
b1b450
+audit_role_change(const char * old_context,
b1b450
+    const char * new_context, const char *ttyn, int result)
b1b450
 {
b1b450
     int au_fd, rc = -1;
b1b450
     char *message;
b1b450
@@ -111,7 +111,7 @@ int
b1b450
 selinux_restore_tty(void)
b1b450
 {
b1b450
     int ret = -1;
b1b450
-    security_context_t chk_tty_con_raw = NULL;
b1b450
+    char * chk_tty_con_raw = NULL;
b1b450
     debug_decl(selinux_restore_tty, SUDO_DEBUG_SELINUX);
b1b450
 
b1b450
     if (se_state.ttyfd == -1 || se_state.new_tty_con_raw == NULL) {
b1b450
@@ -166,8 +166,8 @@ selinux_restore_tty(void)
b1b450
 static int
b1b450
 relabel_tty(const char *ttyn, int ptyfd)
b1b450
 {
b1b450
-    security_context_t tty_con = NULL;
b1b450
-    security_context_t new_tty_con = NULL;
b1b450
+    char * tty_con = NULL;
b1b450
+    char * new_tty_con = NULL;
b1b450
     struct stat sb;
b1b450
     int fd;
b1b450
     debug_decl(relabel_tty, SUDO_DEBUG_SELINUX);
b1b450
@@ -308,10 +308,10 @@ relabel_tty(const char *ttyn, int ptyfd)
b1b450
  * Returns a new security context based on the old context and the
b1b450
  * specified role and type.
b1b450
  */
b1b450
-security_context_t
b1b450
-get_exec_context(security_context_t old_context, const char *role, const char *type)
b1b450
+char *
b1b450
+get_exec_context(char * old_context, const char *role, const char *type)
b1b450
 {
b1b450
-    security_context_t new_context = NULL;
b1b450
+    char * new_context = NULL;
b1b450
     context_t context = NULL;
b1b450
     char *typebuf = NULL;
b1b450
     debug_decl(get_exec_context, SUDO_DEBUG_SELINUX);