emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 33ee326: Fix uses of deprecated SELinux security_context_t


From: Basil L. Contovounesios
Subject: master 33ee326: Fix uses of deprecated SELinux security_context_t
Date: Tue, 28 Jul 2020 07:14:52 -0400 (EDT)

branch: master
commit 33ee3266286db00feef2839e172f613c4370fc1b
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>

    Fix uses of deprecated SELinux security_context_t
    
    SELinux has used 'char *' in place of its typedef
    'security_context_t' since 2014 (v2.3) because the latter was
    inconvenient to use when paired with the 'const' qualifier.  The
    typedef has been kept around for compatibility with legacy callers,
    but it is deprecated in SELinux v3.1.  See the following URL for the
    relevant announcement:
    
https://lore.kernel.org/selinux/20200710162034.GC1768200@localhost.localdomain/
    
    * src/fileio.c (Fcopy_file, Ffile_selinux_context)
    (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Replace deprecated
    'security_context_t' typedef with the equivalent 'char *'.
---
 src/fileio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/fileio.c b/src/fileio.c
index 2f1d2f8..37072d9 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2031,7 +2031,7 @@ permissions.  */)
   ptrdiff_t count = SPECPDL_INDEX ();
   Lisp_Object encoded_file, encoded_newname;
 #if HAVE_LIBSELINUX
-  security_context_t con;
+  char *con;
   int conlength = 0;
 #endif
 #ifdef WINDOWSNT
@@ -3118,7 +3118,7 @@ or if SELinux is disabled, or if Emacs lacks SELinux 
support.  */)
 #if HAVE_LIBSELINUX
   if (is_selinux_enabled ())
     {
-      security_context_t con;
+      char *con;
       int conlength = lgetfilecon (SSDATA (ENCODE_FILE (absname)), &con);
       if (conlength > 0)
        {
@@ -3163,7 +3163,7 @@ or if Emacs was not compiled with SELinux support.  */)
   Lisp_Object role = CAR_SAFE (CDR_SAFE (context));
   Lisp_Object type = CAR_SAFE (CDR_SAFE (CDR_SAFE (context)));
   Lisp_Object range = CAR_SAFE (CDR_SAFE (CDR_SAFE (CDR_SAFE (context))));
-  security_context_t con;
+  char *con;
   bool fail;
   int conlength;
   context_t parsed_con;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]