[dm-devel] [PATCH] umask in device node creation error handling

Florian Zumbiehl florz at florz.de
Wed Aug 26 15:51:17 UTC 2009


Hi,

I guess that the diff is pretty much self-explaining ...

diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c
index b7782a7..554c1a4 100644
--- a/libdm/libdm-common.c
+++ b/libdm/libdm-common.c
@@ -360,6 +360,7 @@ static int _add_dev_node(const char *dev_name, uint32_t major, uint32_t minor,
 
 	old_mask = umask(0);
 	if (mknod(path, S_IFBLK | mode, dev) < 0) {
+		umask(old_mask);
 		log_error("Unable to make device node for '%s'", dev_name);
 		return 0;
 	}

Florian




More information about the dm-devel mailing list