]> 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:38 +0000 (17:34 +0200)
commit9967d79c6f4e6868476bd71fa7f473f3a542d28b
tree66ac898f0a90dedc1ed3ee2795c28053bcb61ef2
parent6abade158b4d279d26e66fb4a24d797ba0cd0716
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