From: Karel Zak Date: Mon, 14 Dec 2020 14:44:59 +0000 (+0100) Subject: mkswap: don't use deprecated security_context_t X-Git-Tag: v2.37-rc1~222 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ca6fcc1a898662027ca671b5cf64f4cc21008ba1;p=thirdparty%2Futil-linux.git 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 --- 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) {