1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

libdm: new name can't be empty

Do not allow passing '' names to kernel.

This test was missing also in kernel, so it has allowed
to create device with '' name.  This then confused dmsetup tool,
since such name is unexpected and unsupported. To remove
such name from table, user has to use -j -m to specify which device
should be removed.

This patch fixes the posibility to run this operation:

dmsetup rename existingdev ''

after this operation commands like  'dmsetup table' are failing.
This patch prohibits to use such name.
This commit is contained in:
Zdenek Kabelac 2013-08-30 14:46:34 +02:00
parent eee3aeeb61
commit 350cf7968c
2 changed files with 6 additions and 0 deletions

View File

@ -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.

View File

@ -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;