util-linux/0002-wipefs-use-O_EXCL.patch
Karel Zak 4d123a0a11 2.22.1-2: apply upstream 2.22.2 patches
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-01 10:28:02 +01:00

28 lines
918 B
Diff

From 9faf9c8494cf37fdcf68b1dfe10fd7900e93ec00 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Mon, 15 Oct 2012 12:38:09 +0200
Subject: [PATCH 02/11] wipefs: use O_EXCL
Address: https://bugzilla.redhat.com/show_bug.cgi?id=865961
Signed-off-by: Karel Zak <kzak@redhat.com>
---
misc-utils/wipefs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c
index cddad8a..0ddc148 100644
--- a/misc-utils/wipefs.c
+++ b/misc-utils/wipefs.c
@@ -309,7 +309,7 @@ static void do_wipe_real(blkid_probe pr, const char *devname, struct wipe_desc *
static struct wipe_desc *
do_wipe(struct wipe_desc *wp, const char *devname, int noact, int all, int quiet)
{
- blkid_probe pr = new_probe(devname, O_RDWR);
+ blkid_probe pr = new_probe(devname, O_RDWR | O_EXCL);
struct wipe_desc *w, *wp0 = clone_offset(wp);
int zap = all ? 1 : wp->zap;
--
1.7.11.7