Your message dated Mon, 10 Mar 2008 21:32:08 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#455745: fixed in devmapper 2:1.02.24-4
has caused the Debian Bug report #455745,
regarding apply patch to provide more atomic device creation
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [EMAIL PROTECTED]
immediately.)


-- 
455745: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=455745
Debian Bug Tracking System
Contact [EMAIL PROTECTED] with problems
--- Begin Message ---
Package: devmapper
Version: 2:1.02.20-2
Severity: wishlist
Tags: patch

Please apply our patch (also submitted upstream) to make the device node
creation more atomic, and avoid races with udev which also attempts to
create these devices.

-- System Information:
Debian Release: lenny/sid
  APT prefers gutsy-updates
  APT policy: (500, 'gutsy-updates'), (500, 'gutsy-security'), (500, 'gutsy')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.22-14-generic (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
--- devmapper-1.02.20.orig/lib/libdm-common.c
+++ devmapper-1.02.20/lib/libdm-common.c
@@ -252,12 +252,11 @@
 static int _add_dev_node(const char *dev_name, uint32_t major, uint32_t minor,
 			 uid_t uid, gid_t gid, mode_t mode)
 {
-	char path[PATH_MAX];
+	char path[PATH_MAX], tmppath[PATH_MAX + 7];
 	struct stat info;
 	dev_t dev = MKDEV(major, minor);
 	mode_t old_mask;
-
-	_build_dev_path(path, sizeof(path), dev_name);
+	int retval;
 
 	if (stat(path, &info) >= 0) {
 		if (!S_ISBLK(info.st_mode)) {
@@ -269,31 +268,39 @@
 		/* If right inode already exists we don't touch uid etc. */
 		if (info.st_rdev == dev)
 			return 1;
-
-		if (unlink(path) < 0) {
-			log_error("Unable to unlink device node for '%s'",
-				  dev_name);
-			return 0;
-		}
 	}
 
+	_build_dev_path(path, sizeof(path), dev_name);
+	strcpy (tmppath, path);
+	strcat (tmppath, ".dm-tmp");
+
 	old_mask = umask(0);
-	if (mknod(path, S_IFBLK | mode, dev) < 0) {
-		log_error("Unable to make device node for '%s'", dev_name);
+	retval = mknod(tmppath, S_IFBLK | mode, dev);
+	umask(old_mask);
+	if (retval < 0) {
+		log_error("Unable to make temporary device node for '%s'", dev_name);
 		return 0;
 	}
-	umask(old_mask);
 
-	if (chown(path, uid, gid) < 0) {
+	if (chown(tmppath, uid, gid) < 0) {
 		log_error("%s: chown failed: %s", path, strerror(errno));
+		unlink(tmppath);
 		return 0;
 	}
 
 #ifdef HAVE_SELINUX
-	if (!dm_set_selinux_context(path, S_IFBLK))
+	if (!dm_set_selinux_context(tmppath, S_IFBLK)) {
+		unlink(tmppath);
 		return 0;
+	}
 #endif
 
+	if (rename(tmppath, path) < 0) {
+		log_error("Unable to replace device node for '%s'", dev_name);
+		unlink(tmppath);
+		return 0;
+	}
+
 	return 1;
 }
 

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---
--- Begin Message ---
Source: devmapper
Source-Version: 2:1.02.24-4

We believe that the bug you reported is fixed in the latest version of
devmapper, which is due to be installed in the Debian FTP archive:

devmapper_1.02.24-4.diff.gz
  to pool/main/d/devmapper/devmapper_1.02.24-4.diff.gz
devmapper_1.02.24-4.dsc
  to pool/main/d/devmapper/devmapper_1.02.24-4.dsc
dmsetup-udeb_1.02.24-4_amd64.udeb
  to pool/main/d/devmapper/dmsetup-udeb_1.02.24-4_amd64.udeb
dmsetup_1.02.24-4_amd64.deb
  to pool/main/d/devmapper/dmsetup_1.02.24-4_amd64.deb
libdevmapper-dev_1.02.24-4_amd64.deb
  to pool/main/d/devmapper/libdevmapper-dev_1.02.24-4_amd64.deb
libdevmapper1.02.1-udeb_1.02.24-4_amd64.udeb
  to pool/main/d/devmapper/libdevmapper1.02.1-udeb_1.02.24-4_amd64.udeb
libdevmapper1.02.1_1.02.24-4_amd64.deb
  to pool/main/d/devmapper/libdevmapper1.02.1_1.02.24-4_amd64.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Bastian Blank <[EMAIL PROTECTED]> (supplier of updated devmapper package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Mon, 10 Mar 2008 22:16:48 +0100
Source: devmapper
Binary: libdevmapper-dev libdevmapper1.02.1 libdevmapper1.02.1-udeb dmsetup 
dmsetup-udeb
Architecture: source amd64
Version: 2:1.02.24-4
Distribution: unstable
Urgency: low
Maintainer: Debian LVM Team <[EMAIL PROTECTED]>
Changed-By: Bastian Blank <[EMAIL PROTECTED]>
Description: 
 dmsetup    - The Linux Kernel Device Mapper userspace library
 dmsetup-udeb - The Linux Kernel Device Mapper userspace library (udeb)
 libdevmapper-dev - The Linux Kernel Device Mapper header files
 libdevmapper1.02.1 - The Linux Kernel Device Mapper userspace library
 libdevmapper1.02.1-udeb - The Linux Kernel Device Mapper userspace library 
(udeb)
Closes: 434241 455745
Changes: 
 devmapper (2:1.02.24-4) unstable; urgency=low
 .
   * Add symbols file for libdevmapper1.02.
   * Add modified version of atomic device creation patch. (closes: #455745)
   * Add modified version of dmsetup export patch. (closes: #434241)
Files: 
 437a6fa9285a822ffc4bdd67a28041d2 768 admin optional devmapper_1.02.24-4.dsc
 1deed5a909cf6f41f24276411f23e191 13257 admin optional 
devmapper_1.02.24-4.diff.gz
 84f41b075dc73acec42a845f82826b70 71496 libdevel optional 
libdevmapper-dev_1.02.24-4_amd64.deb
 2c5c13ac554f2a79c5c1cc16090598d3 55474 libs required 
libdevmapper1.02.1_1.02.24-4_amd64.deb
 3740155722925cc111d58de1dc5deccd 37450 admin optional 
dmsetup_1.02.24-4_amd64.deb
 cd01d678051a9f4b49ad4c299384be3a 39536 debian-installer optional 
libdevmapper1.02.1-udeb_1.02.24-4_amd64.udeb
 53f7d3d3c8ba9f11cad636ec2ead69fc 19032 debian-installer optional 
dmsetup-udeb_1.02.24-4_amd64.udeb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iEYEARECAAYFAkfVp2EACgkQxWtQqFixGB5FSgCfazOdw+u6einacKiocMtOMHcF
IuAAn2twI8CMdMremckCyYOjOo/mnYSE
=+x8Z
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to