Semaphores and access to /dev/shm

Alberto Mardegan alberto.mardegan at canonical.com
Thu Feb 9 07:48:22 UTC 2017


On 09/02/2017 02:22, Jamie Strandboge wrote:
> I confirmed this works fine under confinement (return code checking omitted for
> clarity):
> 
>    char *name = "/dev/shm/sem.snap.foo.bar";
>    open(name, O_CREAT | O_EXCL | O_RDRW, S_IRUSR | S_IWUSR);
>    sem_open("snap.foo.bar", 0);
> 
> As such, sem_open() can work under confinement, but the application needs to be
> written to work within it.

Thanks Jamie, this is helpful!

> Sergio put together snapcraft-preload:
> https://github.com/sergiusens/snapcraft-preload
> 
> It doesn't seem to have sem_open() support yet, but it certainly could.

Cool, I didn't know about this project. I submitted

    https://github.com/sergiusens/snapcraft-preload/issues/2

Ciao,
  Alberto

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20170209/535678f8/attachment.sig>


More information about the Snapcraft mailing list