1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00
Peter Rajnoha 4988d799a2 liblvm2cmd: recognize quotes properly when splitting cmd line string into argv array fields
Fix lvm_split that is called when cmd line string is separated into
argv fields to recognize quote chars ('\'" and '"') properly and
when these quotes are used, consider the text within quotes as one
argument, do not separate it based on space characters inside.

The lvm_split is used during processing lvm shell command line or
when calling lvm commands through cmdlib (e.g. dmeventd plugins).

For example, the lvm shell scenario:

Before this patch:
$lvm
lvm> lvs --config 'global{ suffix=0 }'
  Parse error at byte 9 (line 1): unexpected token
  Failed to set overridden configuration entries.

With this patch applied:
$lvm
lvm> lvs --config 'global{ suffix=0 }'
  LV    VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log  Cpy%Sync Convert
  root  fedora -wi-ao----   9.00g
  swap  fedora -wi-ao---- 512.00m

(Exactly the same problem is hit when calling LVM commands with
quoted arguments via lvm2cmd lib in dmeventd plugins.)
2014-10-17 14:03:43 +02:00
..
2014-08-19 14:33:07 +02:00
2008-01-30 14:00:02 +00:00
2008-01-30 14:00:02 +00:00
2014-09-15 21:33:53 +01:00
2014-09-28 13:49:01 +02:00
2014-10-07 01:15:43 +01:00
2014-10-07 01:15:43 +01:00
2014-10-07 01:15:43 +01:00
2014-01-30 13:09:15 +00:00
2014-10-07 16:45:45 +01:00
2013-07-01 23:11:14 +02:00
2014-03-30 23:44:59 +02:00
2014-07-03 19:06:04 +01:00
2014-10-07 01:15:43 +01:00