Helper library with system functions overrides inside a snap
Currently the library overrides the following functions:
initgroupsandsetgroupsto no-opshm_openandshm_unlinkto prefix the name withsnap.$SNAP_INSTANCE_NAME., as required by snapssem_openandsem_unlink, also fixes the names
To build and install the library run
$ make
$ make install DESTDIR=/some/pathThe snap-preload.so library is intended to be used under LD_PRELOAD, e.g.
$ LD_PRELOAD=/usr/lib/snap-preload.so /usr/bin/myapp ...
Add the following entries to snapcraft.yaml to include the library and
automatically provide the preload to all applications in the snap
environment:
LD_PRELOAD: $SNAP/usr/lib/snap-preload.so
apps:
snap-preload:
plugin: make
source: https://github.com/canonical/snap-preload
source-type: git