[libcxx-commits] [PATCH] D97538: [libcxx] [test] Ifdef out tests that rely on perms::none on directories for triggering errors

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 8 02:09:42 PST 2021

mstorsjo added a comment.

In D97538#2610559 <https://reviews.llvm.org/D97538#2610559>, @curdeius wrote:

> Unfortunately I haven't found anything really satisfying that will provoke this or similar behaviour on Windows without, as Adrian noted, accessing other user's folder or changing ACLs.
> Funnily, I had the very same problem in one of my projects just last week.
> Anyway, speaking of `C:\Users\SomebodyElse` and stuff. That's not really nice to do some setup using a different user.
> But if we used an already existing directory to which a normal user does not have access rights?
> E.g. a normal user cannot write to `C:\Users\Default`.
> Also, one cannot traverse nor read the contents of `C:\System Volume Information` and this folder always exists (at least for Windows 7+, Server 2012+, probably even Server 2008). Maybe this would make the trick, at least for some tests?

Thanks! That does indeed seem to work. Ideally I'd like to first check that it exists before proceeding with a test that assumes its existence and behaviour, but `exists("C:\System Volume Information")` fails as we don't really have access to access the directory much at all. We can iterate over `C:\` and see that it's listed as one of the entries there though.

Converting all these instances to use that does feel like overkill, and most of these tests are kinda redundant with other tests, but there's at least a few instances where it can make sense to use this. And this did uncover a bug regarding the handling of the `skip_permission_denied` flag. I'll post a separate patch for that and a few tests to use that dir, and then we can update this one to ifdef out other cases that are less necessary.

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list