dell / libsmbios

library for interacting with Dell SMBIOS tables
Other
192 stars 39 forks source link

Don't rely on support for indirect expansion in the shell #92

Closed Polynomial-C closed 3 years ago

Polynomial-C commented 3 years ago

POSIX does not define the indirect expansion syntax. Moreover, if going to the trouble of executing Perl, one may as well take full advantage of it. Address the issue by first having the shell export the variable. Next, have Perl perform the replacement without utilising any form of code injection. Instead, export 'var' into Perl's environment. That way, Perl can reference the variable name as $ENV{var} and its value as $ENV{$ENV{var}}.

Signed-off-by: Kerin Millar kfm@plushkava.net Closes: https://bugs.gentoo.org/715202 Closes: https://github.com/dell/libsmbios/issues/89 Signed-off-by: Lars Wendler polynomial-c@gentoo.org