IF pycapnp is asked to load a schema file that it can see (user has at least +r on the directory) but the schema file itself is not readable (user does not have read permission), pycapnp crashes with an bort.
/foo/bar # ls -l
total 4
-rw-r----- 1 root root 633 Jan 7 02:45 addressbook.capnp
/foo/bar # su nonroot
/foo/bar $ python3
Python 3.12.5 (tags/v3.12.5-2-gcf84421-dirty:cf84421, Aug 26 2024, 13:24:52) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import capnp
>>> capnp.load("addressbook.capnp")
terminate called after throwing an instance of 'kj::ExceptionImpl'
what(): kj/filesystem-disk-unix.c++:771: failed: openat(fd, path, O_RDONLY): Permission denied; path = foo/bar/addressbook.capnp
stack: 7081941c383d 7081941c39ac 7081941b4dcf 708194014c20 70819401576b 708193ffb243 708193ff85fa 708193fb9813 708194d60d07 708194d4a4da 708194dd3069 708194df88f9 708194df30ed 708194d2bd28 708194d2bf11 708194c9c78e 708194d2c0ee 708194c97eec 708194dbb287 70819498b187 70819498b24a 643c60afa074
Aborted (core dumped)
/foo/bar $
IF pycapnp is asked to load a schema file that it can see (user has at least +r on the directory) but the schema file itself is not readable (user does not have read permission), pycapnp crashes with an bort.
Steps to reproduce:
root. ( it does not need to be root, I encountered this without root)nonroot