[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] avoiding shell variable expansion
From: |
Eli Schwartz |
Subject: |
Re: [Help-bash] avoiding shell variable expansion |
Date: |
Fri, 4 Oct 2019 02:47:39 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 |
On 10/4/19 2:29 AM, Andy Chu wrote:
> He didn't ask about sanitizing a shell string. He asked about avoiding
> shell expansion. You misread the question, not me.
Then you misread the question even worse.
I'm confused why you think copying a shell variable into another shell
variable (or even an array) is any better of an answer.
In order to "1. Store the command in an array. Quote each arg
properly." you would need to assume the data is being stored in a bash
file which is being sourced.
It's quite plausible to consider your own code with static content to be
a source of shell injection, due to e.g. executing a filename as code.
The given example asked "how to suppress expansion of the asterisk",
which does not require storing and evaluating external user data.
--
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User
signature.asc
Description: OpenPGP digital signature
- [Help-bash] avoiding shell variable expansion, Greg Silverman, 2019/10/03
- Re: [Help-bash] avoiding shell variable expansion, Andy Chu, 2019/10/03
- Re: [Help-bash] avoiding shell variable expansion, Dmitry Alexandrov, 2019/10/03
- Re: [Help-bash] avoiding shell variable expansion, Eli Schwartz, 2019/10/04
- Re: [Help-bash] avoiding shell variable expansion, Andy Chu, 2019/10/04
- Re: [Help-bash] avoiding shell variable expansion, Andy Chu, 2019/10/04
- Re: [Help-bash] avoiding shell variable expansion, Dmitry Alexandrov, 2019/10/04
- Re: [Help-bash] avoiding shell variable expansion, Andy Chu, 2019/10/04
- Re: [Help-bash] avoiding shell variable expansion,
Eli Schwartz <=
Re: [Help-bash] avoiding shell variable expansion, Eli Schwartz, 2019/10/04
Re: [Help-bash] avoiding shell variable expansion, Andreas Kusalananda Kähäri, 2019/10/04
Re: [Help-bash] avoiding shell variable expansion, Stephane Chazelas, 2019/10/04
Re: [Help-bash] avoiding shell variable expansion, Stephane Chazelas, 2019/10/04