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

fix running commands from a script file

Using any arg with a command name in a script file
would cause the command to fail.

The name of the script file being executed was being passed
to lvm_register_commands() and define_commands(), which
prevented command defs from being defined (simple commands
were still being defined only by name which was enough for those
to still work when run trivially with no args).
This commit is contained in:
David Teigland 2017-04-28 16:43:42 -05:00
parent c73b9f062c
commit 54726a4950
2 changed files with 5 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.171 -
==================================
Fix running commands from a script file.
Add pvcreate prompt when device size doesn't match setphysicalvolumesize.
lvconvert - preserve region size on raid1 image count changes
Adjust pvresize/pvcreate messages and prompt if underlying dev size differs.

View File

@ -3444,6 +3444,10 @@ int lvm2_main(int argc, char **argv)
goto_out;
}
/* Can be the name of a script file. */
if (run_name && !find_command_name(run_name))
run_name = NULL;
if (!lvm_register_commands(run_name)) {
ret = ECMD_FAILED;
goto out;