INNER CODE UNIT · C

path_is_allowed_chmod_target

witchan/ios-mcp · mcp-root/main.c:138

static int path_is_allowed_chmod_target(const char *path) {
    static const char *const rawPrefixes[] = {
        "/var/containers/Bundle/Application",
        "/private/var/containers/Bundle/Application",
    };
    char resolvedPath[PATH_MAX];
    size_t i;

    if (!canonicalize_existing_path(path, resolvedPath, sizeof(resolvedPath))) {
        return 0;
    }

    for (i = 0; i < sizeof(rawPrefixes) / sizeof(rawPrefixes[0]); i++) {
        const char *prefix = rawPrefixes[i];

        if (path_has_prefix(resolvedPath, prefix)) {
            return 1;
        }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…