bootspec: split out code that validates whether directory is top-level dir of fs
authorLennart Poettering <lennart@poettering.net>
Tue, 5 Feb 2019 17:52:24 +0000 (18:52 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 1 Mar 2019 11:41:32 +0000 (12:41 +0100)
commit18ae9ef1a52d0f903ada0c5225cb8710a6c0359b
treed676e62bd4f0b1928a56c2b10460c7d9eb04cc5a
parentcedb9eec765ddc5ac28b3141cbb87313650c563d
bootspec: split out code that validates whether directory is top-level dir of fs

Let's add a new function that checks whether some directory is the
top-level directory inside an fs, splitting out the code for this from
verify_esp().

While we are at it, let's slightly improve the code, so that we can
correctly work if we have no priviliges but the ESP is mounted
unaccessible: if we can't stat() the path "$ESP/.." then manually remove
the last component of $ESP and check that instead. Which is very similar
in behaviour, and hopefully good enough in the unprivileged case.
src/shared/bootspec.c