r556 - in devmapper/trunk/debian: . patches

Bastian Blank waldi at alioth.debian.org
Mon Mar 10 20:32:48 UTC 2008


Author: waldi
Date: Mon Mar 10 20:32:48 2008
New Revision: 556

Log:
* debian/changelog: Update.
* debian/patches/atomic.patch: Add.
* debian/patches/series: Add atomic.patch.


Added:
   devmapper/trunk/debian/patches/atomic.patch
Modified:
   devmapper/trunk/debian/changelog
   devmapper/trunk/debian/patches/series

Modified: devmapper/trunk/debian/changelog
==============================================================================
--- devmapper/trunk/debian/changelog	(original)
+++ devmapper/trunk/debian/changelog	Mon Mar 10 20:32:48 2008
@@ -1,3 +1,10 @@
+devmapper (2:1.02.24-4) UNRELEASED; urgency=low
+
+  * Add symbols file for libdevmapper1.02.
+  * Add modified version of atomic device creation patch. (closes: #455745)
+
+ -- Bastian Blank <waldi at debian.org>  Thu, 10 Jan 2008 13:57:41 +0000
+
 devmapper (2:1.02.24-3) unstable; urgency=low
 
   * Always export selinux function.

Added: devmapper/trunk/debian/patches/atomic.patch
==============================================================================
--- (empty file)
+++ devmapper/trunk/debian/patches/atomic.patch	Mon Mar 10 20:32:48 2008
@@ -0,0 +1,73 @@
+--- a/lib/libdm-common.c
++++ b/lib/libdm-common.c
+@@ -263,12 +263,19 @@
+ 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];
+ 	struct stat info;
+ 	dev_t dev = MKDEV(major, minor);
+ 	mode_t old_mask;
+ 
+ 	_build_dev_path(path, sizeof(path), dev_name);
++	_build_dev_path(tmppath, sizeof(tmppath), ".XXXXXX");
++
++	mktemp(tmppath);
++	if (strlen(tmppath) == 0) {
++		log_error("Unable to create name of temporary file");
++		return 0;
++	}
+ 
+ 	if (stat(path, &info) >= 0) {
+ 		if (!S_ISBLK(info.st_mode)) {
+@@ -280,32 +287,35 @@
+ 		/* 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;
+-		}
+ 	}
+ 
+ 	old_mask = umask(0);
+-	if (mknod(path, S_IFBLK | mode, dev) < 0) {
++	if (mknod(tmppath, S_IFBLK | mode, dev) < 0) {
+ 		log_error("Unable to make device node for '%s'", dev_name);
+-		return 0;
++		goto error;
+ 	}
+ 	umask(old_mask);
+ 
+-	if (chown(path, uid, gid) < 0) {
++	if (chown(tmppath, uid, gid) < 0) {
+ 		log_sys_error("chown", path);
+-		return 0;
++		goto error;
+ 	}
+ 
+-	log_debug("Created %s", path);
+-
+-	if (!dm_set_selinux_context(path, S_IFBLK))
+-		return 0;
++	if (!dm_set_selinux_context(tmppath, S_IFBLK))
++		goto error;
+ 
++	if (rename(tmppath, path) < 0) {
++		log_error("Unable to replace device node for '%s'", dev_name);
++		goto error;
++	}
++
++	log_debug("Created %s", path);
++
+ 	return 1;
++
++error:
++	unlink(tmppath);
++	return 0;
+ }
+ 
+ static int _rename_dev_node(const char *old_name, const char *new_name)

Modified: devmapper/trunk/debian/patches/series
==============================================================================
--- devmapper/trunk/debian/patches/series	(original)
+++ devmapper/trunk/debian/patches/series	Mon Mar 10 20:32:48 2008
@@ -3,3 +3,4 @@
 install.patch
 pkgconfig.patch
 abi.patch
+atomic.patch



More information about the pkg-lvm-commits mailing list