Helper library with system functions overrides inside a snap
Currently the library overrides the following functions:
initgroups
andsetgroups
to no-opshm_open
andshm_unlink
to prefix the name withsnap.$SNAP_INSTANCE_NAME.
, as required by snaps
To build and install the library run
$ make
$ make install DESTDIR=/some/path
The 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/maas/snap-preload
source-type: git