+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
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,
{ 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; }
#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
#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
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);