daemon, lib: Replace deprecated security_context_t with char *.

This gives deprecation warnings.  It always was simply a char *, and
the recommendation upstream is to replace uses with char *:

9eb9c93275
(cherry picked from commit eb78e990ac)
This commit is contained in:
Richard W.M. Jones
2020-07-30 13:57:45 +01:00
parent 91698a8500
commit a5e8afb4ed
2 changed files with 3 additions and 5 deletions

View File

@@ -63,8 +63,7 @@ char *
do_getcon (void)
{
#if defined(HAVE_GETCON)
security_context_t context;
char *r;
char *context, *r;
if (getcon (&context) == -1) {
reply_with_perror ("getcon");

View File

@@ -288,8 +288,7 @@ create_cow_overlay_libvirt (guestfs_h *g, void *datav, struct drive *drv)
if (data->selinux_imagelabel) {
debug (g, "setting SELinux label on %s to %s",
overlay, data->selinux_imagelabel);
if (setfilecon (overlay,
(security_context_t) data->selinux_imagelabel) == -1)
if (setfilecon (overlay, data->selinux_imagelabel) == -1)
selinux_warning (g, __func__, "setfilecon", overlay);
}
#endif
@@ -840,7 +839,7 @@ is_custom_hv (guestfs_h *g)
static void
set_socket_create_context (guestfs_h *g)
{
security_context_t scon; /* this is actually a 'char *' */
char *scon;
context_t con;
if (getcon (&scon) == -1) {