jsonnet icon indicating copy to clipboard operation
jsonnet copied to clipboard

Jsonnet fails to locate files irrespective of permissions, JSONNET_PATH

Open TylerGillson opened this issue 4 years ago • 2 comments

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.

TylerGillson avatar Jun 01 '21 23:06 TylerGillson

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.

sbarzowski avatar Jun 01 '21 23:06 sbarzowski

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).

sbarzowski avatar Jul 24 '21 20:07 sbarzowski