Skip to content

config: fetching global config does not work in a sandboxed environment #5190

Description

@eaigner

If a Mac app is sandboxed, the $HOME environment variable points to the container, instead of the actual user home directory, thus preventing the default configuration to load.

On a sandboxed environment $HOME points to: /Users/<usr>/Library/Containers/<app-bundle-id>/Data

The correct way to fetch the home directory for a sandboxed environment according to Apple would be

#include <sys/types.h>
#include <pwd.h>

struct passwd *pw;
pw = getpwuid(getuid());
pw->pw_dir // correct $HOME

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions