Skip to content

POSIX named semaphores are broken for sandboxed Mac apps #232

Description

@JNMSFT

The code below in interprocess/sync/posix/semaphore_wrapper.hpp is broken for sandboxed Mac apps:

   std::string name;
   #ifndef BOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SEMAPHORES
   add_leading_slash(origname, name);
   #else
   create_shared_dir_cleaning_old_and_get_filepath(origname, name);
   #endif

For sandboxed apps, the name of the mutex must be < 32 characters and must be prefixed with an App Group the app is entitled to. For instance, "UBF9AAA6G9.Foo/Bar" is a valid mutex name, but "/UBF9AAA6G9.Foo/Bar" is not. However, add_leading_slash always prepends a slash, which causes sem_open to fail if the app is sandboxed.

Is there an existing preprocessor macro I can define to skip this behavior? It didn't look like it from a quick read of the code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions