chiark / gitweb /
nailing-cargo: Chase down workspace members
When workspaces are in use, we need to look at their members.
This is quite a palaver.
We want to process them after all the stuff in the config, so we must
queue them up when we see them. And we want to chase recursively,
perhaps. (We certainly will do when we extend this to path
dependencies.) So rather than an actual recursive function, we have a
queue.
We use realpath(1) to check that the paths we find don't
escape. (Strictly, this code might [l]stat or readdir various
pathnames controlled by hostile cargo metadata, but that's all.
Basically, I'm assuming it's OK to pass a hostile path to realpath(1)
and then check what realpath(1) said.)
Now we record a manifest as relevant if it has a [workspace], even if
it didn't have a package.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>