jsonnet
jsonnet copied to clipboard
Jsonnet fails to locate files irrespective of permissions, JSONNET_PATH
Regardless of whether JSONNET_PATH is set, the following holds true on RHEL 7 & RHEL 8:
If I attempt to parse a file under /tmp (as the root user) it fails:
touch /tmp/foo.jsonnet
jsonnet /tmp/foo.jsonnet
Opening input file: /tmp/foo.jsonnet: No such file or directory
Permissions for /tmp:
drwxrwxrwt. 16 root root 4096 Jun 1 23:07 tmp
If I try the same thing under /root it works:
touch /root/bar.jsonnet
jsonnet /root/bar.jsonnet
STATIC ERROR: /root/bar.jsonnet:1:1: Unexpected end of file.
I installed jsonnet via snap on both RHEL 7 & 8
jsonnet --version
Jsonnet commandline interpreter v0.9.5
It seems that jsonnet cannot read from any directory beneath / other than /root and /home, regardless of permissions, ownership, etc.
Could snap distribution come with some kind of sandboxing? Jsonnet doesn't have any special logic about reading from these directories. JSONNET_PATH is irrelevant for loading files like that. It's only for resolving imports.
Please let me know if the problem is reproducible with the manually built repo (it's very easy, just git clone && cd jsonnet && make). My suspicion is that it is snap specific (and should be raised with whoever created the snap).