|
2020-12-31
| ||
| 16:00 | • Closed ticket [016bea8571]: Simplify case analysis in safe::AliasGlob plus 5... artifact: c0383f1c05 user: kjnash | |
|
2020-07-18
| ||
| 18:11 | • New ticket [016bea8571]. artifact: e982191a65 user: kjnash | |
Simplify case analysis in safe::AliasGlob
Command ::safe::AliasGlob conspires to require that, in order to supply a valid search pattern to cmd, the caller must supply arguments -directory virtualdir, and the value virtualdir must begin with a valid tokenized directory.
It does this by
- testing that each directory [file join $virtualdir $thedir] (where thedir is the directory part of the search pattern) belongs to the tokenized access path
- NOT translating from tokens the pattern arguments supplied to cmd. Only the virtualdir is translated.
E.g. if -directory virtualdir is not supplied, and the search pattern is {$p(:4:)/*}, the directory is {$p(:4:)} and passes the "access path" test. But the pattern passed to glob as cmd is {$p(:4:)/*} and has no matches against real directories. The glob has no matches.
For the sake of clarity it would be useful to process the case without arguments "-directory virtualdir" near the start of the command, so the case analysis in the rest of the command is simplified.
Fixed in branch safe-bugfixes-8-6 commit [dc38ed6dd6].