1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/tools
Peter Rajnoha 5649834f7d lvmcmdline: return 0/NULL if cmd->arg_values not set and arg_count/grouped_arg_count/arg_value called
We may call arg_count/grouped_arg_count/arg_value soon enough that
cmd->arg_values is not set yet.

Normally, when running a command, we execute lvm_run_command which in
turn calls _process_command_line to allocate and parse the command line
values and stores them in cmd->arg_values.

However, if we run lvm shell, this one doesn't accept any command line
options and we parse the command line for each command that is executed
within the lvm shell then. If we used any code that tries to access
cmd->arg_values through any of the the arg handling functions too
early, we could end up with a segfault due to uninitialized (NULL)
cmd->arg_values.

This patch just saves extra checks in all the code where arg handling
may be called too early so that the cmd->arg_values is not set up yet.
This does not apply to any of existing code, but subsequent patches
will need that.
2016-08-09 18:24:45 +02:00
..
.exported_symbols generate liblvm2cmd exported symbols too 2010-06-25 18:23:10 +00:00
.gitignore gitignore: Update for in-place build. 2015-07-27 13:18:35 +01:00
args.h lvchange: Allow device specification when requesting a repair 2016-08-05 16:01:46 +02:00
cmdnames.h doc: change fsf address 2016-01-21 12:11:37 +01:00
commands.h lvchange: Allow device specification when requesting a repair 2016-08-05 16:01:46 +02:00
dmsetup.c dmstats: fix bounds leak in _do_stats_create_regions() (Coverity) 2016-07-18 18:48:34 +01:00
dumpconfig.c coverity: easier to follow set-up of vsn variable 2016-07-13 21:52:14 +02:00
errors.h doc: change fsf address 2016-01-21 12:11:37 +01:00
formats.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvchange.c lvchange: Allow device specification when requesting a repair 2016-08-05 16:01:46 +02:00
lvconvert_poll.c cleanup: substract integers 2016-05-27 15:47:24 +02:00
lvconvert_poll.h doc: change fsf address 2016-01-21 12:11:37 +01:00
lvconvert.c lvconvert: Fix repair and replace routing. 2016-08-08 23:13:34 +01:00
lvcreate.c lvcreate: reject '--nosync' option for RAID6 LVs 2016-08-08 13:52:35 +02:00
lvdisplay.c tools: Use arg_is_set instead of arg_count. 2016-06-21 22:24:52 +01:00
lvextend.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm2cmd-static.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm2cmd.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm2cmd.h doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm2cmdline.h refactor: move 'interactive' field from struct command_line to struct cmd_context as 'is_interactive' switch 2016-06-20 11:33:43 +02:00
lvm-static.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm.c refactor: move report grouping and log reporting handles from processing_handle to cmd_context 2016-08-09 18:24:45 +02:00
lvmchange.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvmcmdlib.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvmcmdline.c lvmcmdline: return 0/NULL if cmd->arg_values not set and arg_count/grouped_arg_count/arg_value called 2016-08-09 18:24:45 +02:00
lvmdiskscan.c tools: Use arg_is_set instead of arg_count. 2016-06-21 22:24:52 +01:00
lvpoll.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvreduce.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvremove.c lvconvert: use process_each_lv 2016-05-25 15:05:49 -05:00
lvrename.c toollib: make it possible to also process internal VGs, add 'include_internal' switch to process_each_vg fn 2016-06-20 11:33:42 +02:00
lvresize.c lvresize: let pass even protected names like _tmeta 2016-06-24 00:39:14 +02:00
lvscan.c tools: Use arg_is_set instead of arg_count. 2016-06-21 22:24:52 +01:00
Makefile.in vgimportclone: add native command 2016-06-22 13:13:10 -05:00
polldaemon.c toollib: make it possible to also process internal VGs, add 'include_internal' switch to process_each_vg fn 2016-06-20 11:33:42 +02:00
pvchange.c lvmetad: two phase vg_update 2016-06-28 02:30:31 +01:00
pvck.c doc: change fsf address 2016-01-21 12:11:37 +01:00
pvcreate.c lvmetad: two phase vg_update 2016-06-28 02:30:31 +01:00
pvdisplay.c lvmetad: two phase vg_update 2016-06-28 02:30:31 +01:00
pvmove_poll.c doc: change fsf address 2016-01-21 12:11:37 +01:00
pvmove_poll.h doc: change fsf address 2016-01-21 12:11:37 +01:00
pvmove.c tools: Use arg_is_set instead of arg_count. 2016-06-21 22:24:52 +01:00
pvremove.c lvmetad: two phase vg_update 2016-06-28 02:30:31 +01:00
pvresize.c toollib: add 'parent' field to processing_handle; init report format only if there's no parent 2016-06-20 11:33:41 +02:00
pvscan.c lvmetad: two phase vg_update 2016-06-28 02:30:31 +01:00
reporter.c refactor: move report grouping and log reporting handles from processing_handle to cmd_context 2016-08-09 18:24:45 +02:00
segtypes.c doc: change fsf address 2016-01-21 12:11:37 +01:00
stub.h doc: change fsf address 2016-01-21 12:11:37 +01:00
tags.c doc: change fsf address 2016-01-21 12:11:37 +01:00
tool.h doc: change fsf address 2016-01-21 12:11:37 +01:00
toollib.c refactor: move report grouping and log reporting handles from processing_handle to cmd_context 2016-08-09 18:24:45 +02:00
toollib.h refactor: move report grouping and log reporting handles from processing_handle to cmd_context 2016-08-09 18:24:45 +02:00
tools.h args: add priorities for grouping args 2016-06-20 11:33:42 +02:00
vgcfgbackup.c tools: Use arg_is_set instead of arg_count. 2016-06-21 22:24:52 +01:00
vgcfgrestore.c lvmetad: two phase vg_update 2016-06-28 02:30:31 +01:00
vgchange.c lvmlockd: improve message for lock-start 2016-07-25 10:43:06 -05:00
vgck.c toollib: make it possible to also process internal VGs, add 'include_internal' switch to process_each_vg fn 2016-06-20 11:33:42 +02:00
vgconvert.c tools: Use arg_is_set instead of arg_count. 2016-06-21 22:24:52 +01:00
vgcreate.c vgcreate: allow pvcreate force option 2016-07-06 14:10:53 -05:00
vgdisplay.c tools: Use arg_is_set instead of arg_count. 2016-06-21 22:24:52 +01:00
vgexport.c tools: Use arg_is_set instead of arg_count. 2016-06-21 22:24:52 +01:00
vgextend.c lvmetad: two phase vg_update 2016-06-28 02:30:31 +01:00
vgimport.c tools: Use arg_is_set instead of arg_count. 2016-06-21 22:24:52 +01:00
vgimportclone.c lvmetad: two phase vg_update 2016-06-28 02:30:31 +01:00
vgmerge.c doc: change fsf address 2016-01-21 12:11:37 +01:00
vgmknodes.c tools: Use arg_is_set instead of arg_count. 2016-06-21 22:24:52 +01:00
vgreduce.c tools: Use arg_is_set instead of arg_count. 2016-06-21 22:24:52 +01:00
vgremove.c toollib: make it possible to also process internal VGs, add 'include_internal' switch to process_each_vg fn 2016-06-20 11:33:42 +02:00
vgrename.c lvmetad: two phase vg_update 2016-06-28 02:30:31 +01:00
vgscan.c lvmetad: two phase vg_update 2016-06-28 02:30:31 +01:00
vgsplit.c vgsplit: ea90a3d622 added an unconditional call to lv_is_on_pvs() 2016-07-28 18:35:33 +02:00