diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index 3995187ac..f5d7dc2d9 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.80 - ================================== + Do not allow passing empty new name for dmsetup rename. Display any output returned by 'dmsetup message'. Add dm_task_get_message_response to libdevmapper. diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c index 904335241..c0669cbd5 100644 --- a/libdm/libdm-common.c +++ b/libdm/libdm-common.c @@ -698,6 +698,11 @@ int dm_task_set_newname(struct dm_task *dmt, const char *newname) return 0; } + if (!*newname) { + log_error("Non empty new name is required."); + return 0; + } + if (!check_multiple_mangled_string_allowed(newname, "new name", mangling_mode)) return_0;