tcc

package
v0.175.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tcc keeps an isolated Caprock daemon out of the folders macOS guards with a privacy prompt (ADR-040).

macOS asks before a process reads the account's Desktop, Documents or Downloads, and remembers the answer per program — for a command-line binary, per path and code signature. A daemon a test, a benchmark or a preview starts runs from a build of its own, so every one that reaches into those folders is another "caprock" in System Settings → Privacy & Security → Files and Folders, and a prompt on the owner's screen. A preview that copies the real database knows the real projects, some of which live there.

An isolated daemon is one whose HOME is not the account's home: every test and stand sets a temporary HOME. Such a daemon refuses those folders of the real account, whatever its database says. The daemon the user runs has its real HOME and is never limited.

Index

Constants

This section is empty.

Variables

View Source
var ErrOffLimits = errors.New("an isolated daemon does not touch the account's Desktop, Documents or Downloads")

ErrOffLimits is returned for a path an isolated daemon does not touch.

View Source
var Folders = []string{"Desktop", "Documents", "Downloads"}

Folders are the account folders macOS asks about, relative to its home.

Functions

func Check

func Check(path string) error

Check returns ErrOffLimits for a path an isolated daemon must leave alone.

func Guarded added in v0.94.1

func Guarded(p string) bool

Guarded reports whether reading at or below p would make macOS ask the user for access — for any process, isolated or not. Background work (the repository a session's folder belongs to, the projects list, the folder picker's hints, the Projects panel's git) skips such a place; a read the user asked for (opening a session, a file, a folder) does not.

The places are the account's Desktop, Documents and Downloads, iCloud Drive and cloud-storage providers, the Music, Movies and Pictures folders (the Apple Music, TV and Photos libraries live there), and every mounted volume under /Volumes (removable and network volumes each have their own prompt). Caprock's binary is ad-hoc signed, so macOS treats each release as a new program and an answer given to the last one does not carry over: a background read there asked again after every upgrade.

Symbolic links are followed without touching what they point at: a link in ~/dev to a network share is guarded, and finding that out reads the links, never the share.

func GuardedBeyondWork added in v0.94.1

func GuardedBeyondWork(p string) bool

GuardedBeyondWork is Guarded without Desktop, Documents and Downloads, for reads up a session's own folder (finding its repository): people keep their projects in Documents, a session there means the user works there, and one prompt per release for that folder is the honest price of grouping it by repository. Music, Movies, Pictures, iCloud Drive, cloud storage and /Volumes stay untouched even then.

func Isolated

func Isolated() bool

Isolated reports whether this daemon runs isolated on macOS and so keeps out of the account's guarded folders.

func OffLimits

func OffLimits(path string) bool

OffLimits reports whether an isolated daemon must leave path alone.

func Target added in v0.94.1

func Target(p string) (string, bool)

Target is where p leads once symbolic links are followed, as far as that is possible without entering a guarded place, and whether it leads into one. A target inside a guarded place is spelled out but never read.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL