]> git.ipfire.org Git - thirdparty/openssl.git/commit
Split arguments taking quotes into account
authorViktor Dukhovni <openssl-users@dukhovni.org>
Sun, 1 Jun 2025 02:47:15 +0000 (12:47 +1000)
committerTomas Mraz <tomas@openssl.org>
Wed, 4 Jun 2025 15:34:31 +0000 (17:34 +0200)
commit2ac3267a86f99fb6ba52b2df52944bd1eee2971e
treee1d69652d6bb61010fdfecbf357d93e485584fb6
parentb25f51a5dc3831f9358637e4372bf76b76d4f864
Split arguments taking quotes into account

CA.pl supports interpolating multiple arguments into the executed
commands.  Previously these were evaluated by a shell, which supported
quoting of values that contain whitespace, backslashes, ...

With a shell no longer used (avoid command injection), backwards
compatibility requires some similar functionality.  The code now handles
double and single-quoted strings (shell-style word splitting), but not
parameter expansion ($foo remains unexpanded) or command substitution
(`cmd` and $(cmd) remain unexpanded).

On Windows system(@LIST) does not correctly preserve argv, do our
own quoting instead and use system(<$quoted_cmd>).

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27432)

(cherry picked from commit 287bbb28b09e930a8691efc92a5087bb951edb6b)
apps/CA.pl.in
test/recipes/80-test_ca.t
util/wrap.pl.in