diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2017-08-22 10:19:40 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2017-08-22 10:23:29 +0200 |
commit | 0e42b31dc3be45c29abd90369c02c077d1763ff0 (patch) | |
tree | 1f32fabca736e647f8496fdfd8e0d0792024eb1f | |
parent | df5c2964269895b6f5ce16dbdb70edd57c5aa67d (diff) | |
download | lvm2-0e42b31dc3be45c29abd90369c02c077d1763ff0.tar.gz |
libdm: fix errpath for control node creation
When control node failure happens, umask was not restored.
Fix it by using common exit path.
-rw-r--r-- | WHATS_NEW_DM | 1 | ||||
-rw-r--r-- | libdm/ioctl/libdm-iface.c | 5 |
2 files changed, 3 insertions, 3 deletions
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index d3cc78cd0..766eb200f 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.143 - ================================= + Restore umask when creation of node fails. Add --concise to dmsetup create for many devices with tables in one command. Accept minor number without major in library when it knows dm major number. Introduce single-line concise table output format: dmsetup table --concise diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c index e32af80ef..63d305b33 100644 --- a/libdm/ioctl/libdm-iface.c +++ b/libdm/ioctl/libdm-iface.c @@ -293,13 +293,12 @@ static int _create_control(const char *control, uint32_t major, uint32_t minor) if (mknod(control, S_IFCHR | S_IRUSR | S_IWUSR, MKDEV((dev_t)major, (dev_t)minor)) < 0) { log_sys_error("mknod", control); - (void) dm_prepare_selinux_context(NULL, 0); - return 0; + ret = 0; } umask(old_umask); (void) dm_prepare_selinux_context(NULL, 0); - return 1; + return ret; } #endif |