On Wednesday, 18 October 2017 07:05:46 PDT Matt Hoosier wrote:
> On Wed, Oct 18, 2017 at 4:23 AM, Quentin Glidic
> 
> <sardemff7+wayl...@sardemff7.net> wrote:
> > +       fd = shm_open("/wayland-cursor-shared", O_CREAT | O_RDWR, 0);
> > +       shm_unlink("/wayland-cursor-shared");
> 
> This seems to be a departure from the anonymous behavior that
> mkstemp() previously offered. shm_open() says that it will open an
> existing shared-memory object if that pathname already exists. Isn't
> there a race between one thread doing shm_open() and a different
> thread doing shm_unlink() such that you could accidentally end up with
> two different filedescriptors pointing at the same SHM object?

There's another problem: this path is not unique to the calling user. That 
means you need to defend against another user in the system actively trying to 
get to your files or forcing you to open the wrong file.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to