nlewo/nix2container

perms regex is too lax

the-sun-will-rise-tomorrow opened this issue · 1 comments

If I set perms = [{ regex = "/tmp"; }] then that also matches /some/path/tmp.

I tried to use regex = "^/tmp$" but now that doesn't seem to match anything.

I think it should be possible to set the permissions for one specific, exactly specified path.

Ah, I figured it out.

You have to do regex = "^/nix/store/abcd......../tmp$";.

I was misled by the use of .* in documentation and examples. Usually, it makes sense and is needed if there is some kind of ^...$ added to the pattern implicitly elsewhere. But, since there is not, it is rendundant - foo and foo.* both mean the same thing as .*foo.*.