From: Karel Zak Date: Mon, 15 Oct 2012 10:38:09 +0000 (+0200) Subject: wipefs: use O_EXCL X-Git-Tag: v2.23-rc1~641 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c550f728f724360f99aae0fdb45b0589d9a347e0;p=thirdparty%2Futil-linux.git wipefs: use O_EXCL Address: https://bugzilla.redhat.com/show_bug.cgi?id=865961 Signed-off-by: Karel Zak --- diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c index cddad8a0e3..0ddc148d02 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;