From 5f1c57d0084236e01e80f668049270ead7ce0675 Mon Sep 17 00:00:00 2001 From: Dave Wysochanski Date: Thu, 3 Sep 2009 21:51:26 +0000 Subject: [PATCH] Restore umask when device node creation fails. Author: Florian Zumbiehl Acked-by: Dave Wysochanski --- WHATS_NEW_DM | 1 + libdm/libdm-common.c | 1 + 2 files changed, 2 insertions(+) diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index e6cdcc301..73398a588 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.37 - ================================= + Restore umask when device node creation fails. Fix mirror table CTR code to handle 'block_on_error' and 'cluster' features Version 1.02.36 - 6th August 2009 diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c index b7782a7ec..554c1a490 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; }