]> Savannah Git Hosting - gnulib.git/commitdiff
selinux-at, selinux-h: use const correct declarations
authorPádraig Brady <P@draigBrady.com>
Mon, 23 Nov 2020 15:14:50 +0000 (15:14 +0000)
committerPádraig Brady <P@draigBrady.com>
Mon, 23 Nov 2020 15:18:26 +0000 (15:18 +0000)
* lib/se-selinux.in.h: Use const for "set" functions,
to match current selinux, and support cleaner user code.
* lib/selinux-at.c: Likewise.
* lib/selinux-at.h: Likewise.

ChangeLog
lib/se-selinux.in.h
lib/selinux-at.c
lib/selinux-at.h

index 044b12d8c0ee44b946cb4772cf4b22a63cf36b46..a17f2b208bf805ae54f6affad4bfeacd7e9cf9d5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2020-11-23  Pádraig Brady  <P@draigBrady.com>
+
+       selinux-at, selinux-h: use const correct declarations
+       * lib/se-selinux.in.h: Use const for "set" functions,
+       to match current selinux, and support cleaner user code.
+       * lib/selinux-at.c: Likewise.
+       * lib/selinux-at.h: Likewise.
+
 2020-11-22  Paul Eggert  <eggert@cs.ucla.edu>
 
        canonicalize-lgpl: fix memory leak
index a6c194aa0ee952fec79598f88dc39cb224b2934b..67d034d0f8392422f6abf31b35c0c024cc037e86 100644 (file)
@@ -56,7 +56,7 @@ SE_SELINUX_INLINE int
 getfscreatecon (char **con _GL_UNUSED_PARAMETER)
   { errno = ENOTSUP; return -1; }
 SE_SELINUX_INLINE int
-setfscreatecon (char *con _GL_UNUSED_PARAMETER)
+setfscreatecon (char const *con _GL_UNUSED_PARAMETER)
   { errno = ENOTSUP; return -1; }
 SE_SELINUX_INLINE int
 matchpathcon (char const *file _GL_UNUSED_PARAMETER,
@@ -76,29 +76,29 @@ fgetfilecon (int fd, char **con _GL_UNUSED_PARAMETER)
   { errno = ENOTSUP; return -1; }
 SE_SELINUX_INLINE int
 setfilecon (char const *file _GL_UNUSED_PARAMETER,
-            char *con _GL_UNUSED_PARAMETER)
+            char const *con _GL_UNUSED_PARAMETER)
   { errno = ENOTSUP; return -1; }
 SE_SELINUX_INLINE int
 lsetfilecon (char const *file _GL_UNUSED_PARAMETER,
-             char *con _GL_UNUSED_PARAMETER)
+             char const *con _GL_UNUSED_PARAMETER)
   { errno = ENOTSUP; return -1; }
 SE_SELINUX_INLINE int
 fsetfilecon (int fd _GL_UNUSED_PARAMETER,
-             char *con _GL_UNUSED_PARAMETER)
+             char const *con _GL_UNUSED_PARAMETER)
   { errno = ENOTSUP; return -1; }
 
 SE_SELINUX_INLINE int
-security_check_context (char *con _GL_UNUSED_PARAMETER)
+security_check_context (char const *con _GL_UNUSED_PARAMETER)
   { errno = ENOTSUP; return -1; }
 SE_SELINUX_INLINE int
-security_check_context_raw (char *con _GL_UNUSED_PARAMETER)
+security_check_context_raw (char const *con _GL_UNUSED_PARAMETER)
   { errno = ENOTSUP; return -1; }
 SE_SELINUX_INLINE int
-setexeccon (char *con _GL_UNUSED_PARAMETER)
+setexeccon (char const *con _GL_UNUSED_PARAMETER)
   { errno = ENOTSUP; return -1; }
 SE_SELINUX_INLINE int
-security_compute_create (char *scon _GL_UNUSED_PARAMETER,
-                         char *tcon _GL_UNUSED_PARAMETER,
+security_compute_create (char const *scon _GL_UNUSED_PARAMETER,
+                         char const *tcon _GL_UNUSED_PARAMETER,
                          security_class_t tclass _GL_UNUSED_PARAMETER,
                          char **newcon _GL_UNUSED_PARAMETER)
   { errno = ENOTSUP; return -1; }
index 105a9f9d5c85940ffbb2d1548c1954a925ca9b92..e1d214c2a056e30117fbc946fe096b86a848d922 100644 (file)
@@ -52,7 +52,7 @@
 
 #define AT_FUNC_NAME setfileconat
 #define AT_FUNC_F1 setfilecon
-#define AT_FUNC_POST_FILE_PARAM_DECLS , char *con
+#define AT_FUNC_POST_FILE_PARAM_DECLS , char const *con
 #define AT_FUNC_POST_FILE_ARGS        , con
 #include "at-func.c"
 #undef AT_FUNC_NAME
@@ -62,7 +62,7 @@
 
 #define AT_FUNC_NAME lsetfileconat
 #define AT_FUNC_F1 lsetfilecon
-#define AT_FUNC_POST_FILE_PARAM_DECLS , char *con
+#define AT_FUNC_POST_FILE_PARAM_DECLS , char const *con
 #define AT_FUNC_POST_FILE_ARGS        , con
 #include "at-func.c"
 #undef AT_FUNC_NAME
index 50537f80f46472d6b1f9fcfb9440559f96cd9687..9b331cb1824a1905ae0001a3691b0503b3918548 100644 (file)
@@ -42,11 +42,11 @@ int lgetfileconat (int dir_fd, char const *file, char **con);
    the file specified by DIR_FD and FILE to CON.  DIR_FD and FILE are
    interpreted as for fstatat[*].  Upon success, return 0.
    Otherwise, return -1 and set errno.  */
-int  setfileconat (int dir_fd, char const *file, char *con);
+int  setfileconat (int dir_fd, char const *file, char const *con);
 
 /* dir-fd-relative lsetfilecon.  This function is just like setfileconat,
    except that rather than dereferencing a symlink, this function affects it. */
 /* dir-fd-relative lsetfilecon.  This function is just like setfileconat,
    except when DIR_FD and FILE specify a symlink:  lsetfileconat operates on
    the symlink, while setfileconat operates on the referent of the symlink.  */
-int lsetfileconat (int dir_fd, char const *file, char *con);
+int lsetfileconat (int dir_fd, char const *file, char const *con);