Blame SOURCES/0148-mkswap-tolerate-ENOTSUP-when-failing-to-relabel.patch

304038
From a656eda4cf268f555563d45808df4bb1df54c95f Mon Sep 17 00:00:00 2001
304038
From: Lubomir Rintel <lkundrak@v3.sk>
304038
Date: Mon, 18 Apr 2016 09:01:23 +0200
304038
Subject: [PATCH] mkswap: tolerate ENOTSUP when failing to relabel
304038
304038
It might be that the underlying filesystem just doesn't support SELinux
304038
labeling. This fixes creating swap on vfat live media:
304038
304038
  # livecd-iso-to-disk.sh --msdos --swap-size-mb 666 ...
304038
304038
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1538545
304038
Upstream: http://github.com/karelzak/util-linux/commit/d97dc0ee2505e80c8e9fca89aa2001b2ec2c3695
304038
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
304038
Signed-off-by: Karel Zak <kzak@redhat.com>
304038
---
304038
 disk-utils/mkswap.c | 2 +-
304038
 1 file changed, 1 insertion(+), 1 deletion(-)
304038
304038
diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c
304038
index ec6fc5f99..ff47f2038 100644
304038
--- a/disk-utils/mkswap.c
304038
+++ b/disk-utils/mkswap.c
304038
@@ -656,7 +656,7 @@ main(int argc, char **argv) {
304038
 		context_string = context_str(newcontext);
304038
 
304038
 		if (strcmp(context_string, oldcontext)!=0) {
304038
-			if (fsetfilecon(DEV, context_string))
304038
+			if (fsetfilecon(DEV, context_string) && errno != ENOTSUP)
304038
 				err(EXIT_FAILURE, _("unable to relabel %s to %s"),
304038
 						device_name, context_string);
304038
 		}
304038
-- 
304038
2.13.6
304038