chiark / gitweb /
nailing-cargo: Chase down workspace members
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 25 Jul 2020 16:04:31 +0000 (17:04 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 25 Jul 2020 16:08:45 +0000 (17:08 +0100)
commitac4f337ad7d7e70e5d5d0d3f7eb51025c21a5fec
treec346b8e59841a921e1f54137acb8892c310b8d2f
parentccfdd1920f72e52b047f74677eb7730090f8e633
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>
nailing-cargo