Skip to content
Tcl Source Code View Ticket
Login

View Ticket

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

Closed / Fixed016bea8571bfe22d30ce150e63c5bccdbfee2e5eCreated 6 years agoUpdated 6 years ago
Descriptionwiki2020-07-18 18:11:39
Command ::safe::AliasGlob constructs a command cmd to be passed to the safe interpreter's hidden glob command.

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

  1. testing that each directory [file join $virtualdir $thedir] (where thedir is the directory part of the search pattern) belongs to the tokenized access path
  2. 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].

kjnash Closed ticket [016bea8571]. [History diff]2020-12-31 16:00:52
Log in (anonymous is fine) to add a comment.