cdown / rpms / util-linux

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