libguestfs/SOURCES/0001-daemon-lib-Replace-dep...

57 lines
1.8 KiB
Diff

From a5e8afb4ed8576a1b3398add2ede49a1f90ad01a Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 30 Jul 2020 13:57:45 +0100
Subject: [PATCH] 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 *:
https://github.com/SELinuxProject/selinux/commit/9eb9c9327563014ad6a807814e7975424642d5b9
(cherry picked from commit eb78e990ac5277a4282293f8787af871a1420b61)
---
daemon/selinux.c | 3 +--
lib/launch-libvirt.c | 5 ++---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/daemon/selinux.c b/daemon/selinux.c
index 1c1446d30..f4d839c19 100644
--- a/daemon/selinux.c
+++ b/daemon/selinux.c
@@ -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");
diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
index bc5978cc4..4a47bbb29 100644
--- a/lib/launch-libvirt.c
+++ b/lib/launch-libvirt.c
@@ -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) {
--
2.18.4