[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: uname lead to embed code execution
From: |
Koichi Murase |
Subject: |
Re: uname lead to embed code execution |
Date: |
Mon, 1 Mar 2021 18:56:06 +0800 |
2021年3月1日(月) 18:37 felix <felix@f-hauri.ch>:
> $ unset map["$key"]
> Linux
This is a topic that is often discussed on this mailing list, and I
think the conclusion is that we should always write it as
$ unset 'map[$key]'
In addition to the extra expansions of the array subscripts, `unset
map["$key"]' has another problem. For example, when there is a file
named `mapf', it will be expanded to `unset mapf'. When there are no
matching filenames but `shopt -s failglob/nullglob' is set, it will
also result in unexpected behavior. You can also see
https://mywiki.wooledge.org/BashPitfalls#unset_a.5B0.5D
--
Koichi