cdown / rpms / util-linux

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