Skip to content

Commit

Permalink
Sandbox detection
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Aug 18, 2023
1 parent f5aa3a5 commit 83f1ebc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Sources/ProcessEnv/ProcessInfo+UserEnvironment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ extension ProcessInfo {
return ""
}

public var sandboxContainerId: String? {
environment["APP_SANDBOX_CONTAINER_ID"]
}

/// Returns true if the process is running with sandboxing enabled.
public var isSandboxed: Bool {
sandboxContainerId != nil
}

/// Capture the interactive-login shell environment
///
/// This method attempts to reconstruct the user
Expand Down

0 comments on commit 83f1ebc

Please sign in to comment.