Blame SOURCES/sudo-1.9.5-selinux-t.patch

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