From ca6fcc1a898662027ca671b5cf64f4cc21008ba1 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 14 Dec 2020 15:44:59 +0100 Subject: [PATCH] mkswap: don't use deprecated security_context_t libselinux >= 3.1 makes security_context_t type deprecated. Let's ifdef it to avoid unwanted warnings. Signed-off-by: Karel Zak --- disk-utils/mkswap.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c index be70617326..631e702849 100644 --- a/disk-utils/mkswap.c +++ b/disk-utils/mkswap.c @@ -628,8 +628,11 @@ int main(int argc, char **argv) #ifdef HAVE_LIBSELINUX if (S_ISREG(ctl.devstat.st_mode) && is_selinux_enabled() > 0) { - security_context_t context_string; - security_context_t oldcontext; +# ifdef HAVE_SELINUX_CONTEXT_T + security_context_t context_string, oldcontext; /* deprecated */ +# else + char *context_string, *oldcontext; /* since libselinux >= 3.1 */ +# endif context_t newcontext; if (fgetfilecon(ctl.fd, &oldcontext) < 0) { -- 2.47.3