From aa477c8c9fc2d7704430eb82625cf1d8b1a73bab5f1e337569a10c923f8330d4 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Fri, 2 Feb 2007 14:55:36 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/util-linux?expand=0&rev=2 --- util-linux-2.12r-mkfs_open_exclusive.patch | 39 ++++++++++++++++++++++ util-linux.changes | 10 ++++++ util-linux.spec | 10 ++++-- 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 util-linux-2.12r-mkfs_open_exclusive.patch diff --git a/util-linux-2.12r-mkfs_open_exclusive.patch b/util-linux-2.12r-mkfs_open_exclusive.patch new file mode 100644 index 0000000..f94d3b2 --- /dev/null +++ b/util-linux-2.12r-mkfs_open_exclusive.patch @@ -0,0 +1,39 @@ +Index: util-linux-2.12r/disk-utils/mkswap.c +=================================================================== +--- util-linux-2.12r.orig/disk-utils/mkswap.c ++++ util-linux-2.12r/disk-utils/mkswap.c +@@ -645,7 +645,7 @@ main(int argc, char ** argv) { + usage(); + } + +- DEV = open(device_name,O_RDWR); ++ DEV = open(device_name, O_RDWR | O_EXCL); + if (DEV < 0 || fstat(DEV, &statbuf) < 0) { + perror(device_name); + exit(1); +Index: util-linux-2.12r/disk-utils/mkfs.minix.c +=================================================================== +--- util-linux-2.12r.orig/disk-utils/mkfs.minix.c ++++ util-linux-2.12r/disk-utils/mkfs.minix.c +@@ -699,7 +699,7 @@ main(int argc, char ** argv) { + tmp += dirsize; + *(short *)tmp = 2; + strcpy(tmp+2,".badblocks"); +- DEV = open(device_name,O_RDWR ); ++ DEV = open(device_name,O_RDWR | O_EXCL); + if (DEV<0) + die(_("unable to open %s")); + if (fstat(DEV,&statbuf)<0) +Index: util-linux-2.12r/disk-utils/mkfs.bfs.c +=================================================================== +--- util-linux-2.12r.orig/disk-utils/mkfs.bfs.c ++++ util-linux-2.12r/disk-utils/mkfs.bfs.c +@@ -170,7 +170,7 @@ main(int argc, char *argv[]) { + if (!S_ISBLK(statbuf.st_mode)) + fatal(_("%s is not a block special device"), device); + +- fd = open(device, O_RDWR); ++ fd = open(device, O_RDWR | O_EXCL); + if (fd == -1) { + perror(device); + fatal(_("cannot open %s"), device); diff --git a/util-linux.changes b/util-linux.changes index 274fc7b..ff33713 100644 --- a/util-linux.changes +++ b/util-linux.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Fri Feb 2 13:27:31 CET 2007 - mkoenig@suse.de + +- do not use O_EXCL for mkfs.cramfs [#241466] + +------------------------------------------------------------------- +Wed Jan 31 12:06:55 CET 2007 - mkoenig@suse.de + +- let mkfs tools open with O_EXCL [#238687] + ------------------------------------------------------------------- Tue Dec 12 11:04:07 CET 2006 - mkoenig@suse.de diff --git a/util-linux.spec b/util-linux.spec index 2fd8d73..ed1e651 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -1,7 +1,7 @@ # # spec file for package util-linux (Version 2.12r) # -# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # @@ -20,7 +20,7 @@ License: BSD License and BSD-like, GNU General Public License (GPL) Group: System/Base Autoreqprov: on Version: 2.12r -Release: 64 +Release: 70 Summary: A collection of basic system utilities Source: ftp://ftp.kernel.org/pub/linux/utils/util-linux/%name-%version.tar.bz2 Source2: nologin.c @@ -108,6 +108,7 @@ Patch106: util-linux-2.12r-partx.patch Patch107: util-linux-2.12r-mkswap_fix.patch Patch108: util-linux-2.12r-nfs_remount_options.patch Patch109: util-linux-2.12r-losetup_password.patch +Patch110: util-linux-2.12r-mkfs_open_exclusive.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build PreReq: %insserv_prereq %fillup_prereq /bin/sed @@ -181,6 +182,7 @@ cd - %patch107 -p1 %patch108 -p1 %patch109 -p1 +%patch110 -p1 # setctsid cp %{S:22} %{S:23} . # nologin and guessfstype @@ -614,6 +616,10 @@ fi %endif %changelog -n util-linux +* Fri Feb 02 2007 - mkoenig@suse.de +- do not use O_EXCL for mkfs.cramfs [#241466] +* Wed Jan 31 2007 - mkoenig@suse.de +- let mkfs tools open with O_EXCL [#238687] * Tue Dec 12 2006 - mkoenig@suse.de - provide different return codes for losetup with encryption for empty and too short passwords. [#197493]