diff --git a/WHATS_NEW b/WHATS_NEW index d7a00fe42..0d4487e10 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.112 - ===================================== + Fix liblvm2cmd and lvm shell to respect quotes around args in cmd line string. Permit extent sizes > 128KB that are not power of 2 with lvm2 format. Remove workaround for lvm2-monitor.service hang on stop if lvmetad stopped. Change vgremove to use process_each_lv_in_vg. diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c index 4697b24f6..4c6133230 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -1407,6 +1407,7 @@ int lvm_split(char *str, int *argc, char **argv, int max) { char *b = str, *e; *argc = 0; + char quote = 0; while (*b) { while (*b && isspace(*b)) @@ -1415,14 +1416,20 @@ int lvm_split(char *str, int *argc, char **argv, int max) if ((!*b) || (*b == '#')) break; + if (*b == '\'' || *b == '"') { + quote = *b; + b++; + } + e = b; - while (*e && !isspace(*e)) + while (*e && (quote ? *e != quote : !isspace(*e))) e++; argv[(*argc)++] = b; if (!*e) break; *e++ = '\0'; + quote = 0; b = e; if (*argc == max) break;