executor

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 18 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HardenCommand added in v1.16.0

func HardenCommand(cmd *exec.Cmd)

HardenCommand applies the process-level safeguards every command this agent spawns needs: no console window on Windows, and a cancellation that reaches the whole process group rather than only the immediate child.

Exported for callers that build their own *exec.Cmd because they need stream or environment handling the methods above do not express. Those callers still need the teardown, and this is where it is defined rather than re-derived, correctly or otherwise, beside each such command. Run and RunInDir apply the same pair inline.

func LookPathWithContext added in v1.17.0

func LookPathWithContext(ctx context.Context, exec Executor, name string) (string, error)

LookPathWithContext resolves name without outliving the caller's deadline.

func MockDirEntry added in v1.10.0

func MockDirEntry(name string, isDir bool) os.DirEntry

MockDirEntry creates an os.DirEntry for use with SetDirEntries.

func MockIrregularDirEntry added in v1.17.0

func MockIrregularDirEntry(name string) os.DirEntry

MockIrregularDirEntry creates an os.DirEntry whose Type() reports os.ModeIrregular (IsDir() and symlink both false) — what os.ReadDir reports for a Windows directory junction. Pair it with SetReadlink for the target.

func MockSymlinkDirEntry added in v1.14.0

func MockSymlinkDirEntry(name string) os.DirEntry

MockSymlinkDirEntry creates an os.DirEntry whose Type() reports os.ModeSymlink (IsDir() is false), for exercising symlinked directory entries. Pair it with SetSymlink to stub the resolution target.

func ResolveHome added in v1.11.4

func ResolveHome(exec Executor) string

ResolveHome returns the home directory of the console (GUI) user when present, falling back to the process's current user. Returns an empty string when neither resolves — callers degrade gracefully.

On macOS the LoggedInUser path uses `stat /dev/console` to find the real GUI user even when the agent runs as root via launchd (issue #63), so this is the correct anchor for per-user paths like the TCC skip list. Shared by both community-mode scan and enterprise telemetry to keep them in lock-step.

func UserEnvironmentError added in v1.17.0

func UserEnvironmentError(exec Executor) error

UserEnvironmentError reports a failed target-user environment snapshot.

Types

type Executor

type Executor interface {
	// GuardedFiles restricts ReadFile, ReadDir, Stat and EvalSymlinks to roots
	// and guard. Other operations retain their original behavior.
	GuardedFiles(roots []string, guard func(string) string, maxReadBytes int64) Executor
	// Run executes a command and returns stdout, stderr, and exit code.
	Run(ctx context.Context, name string, args ...string) (stdout, stderr string, exitCode int, err error)
	// RunWithTimeout executes a command with a timeout.
	RunWithTimeout(ctx context.Context, timeout time.Duration, name string, args ...string) (stdout, stderr string, exitCode int, err error)
	// RunInDir executes a command with a working directory and timeout.
	// Avoids shell quoting issues with cd on Windows.
	RunInDir(ctx context.Context, dir string, timeout time.Duration, name string, args ...string) (stdout, stderr string, exitCode int, err error)
	// RunAsUser runs a shell command as a specific user (for root -> user delegation).
	RunAsUser(ctx context.Context, username, command string) (string, error)
	// StartDetached launches a command and returns as soon as it has started,
	// without waiting for it to finish and without tying its lifetime to this
	// process. Used to trigger a scan inside a WSL distribution: the scan
	// outlives the run that started it, and its own agent reports the result.
	// The error covers failure to *start* only — anything the child does
	// afterwards is invisible here by design.
	StartDetached(name string, args ...string) error
	// LookPath searches for an executable in PATH.
	LookPath(name string) (string, error)
	// FileExists checks if a file exists and is not a directory.
	FileExists(path string) bool
	// DirExists checks if a directory exists.
	DirExists(path string) bool
	// ReadFile reads a file's contents.
	ReadFile(path string) ([]byte, error)
	// ReadDir lists directory entries.
	ReadDir(path string) ([]os.DirEntry, error)
	// ReadDirLimit lists at most max entries, reading no more than max+1 from
	// the directory; more reports that entries were left unread. Entries are
	// sorted by name.
	ReadDirLimit(path string, max int) (entries []os.DirEntry, more bool, err error)
	// Stat returns file info.
	Stat(path string) (os.FileInfo, error)
	// Hostname returns the system hostname.
	Hostname() (string, error)
	// Getenv reads an environment variable.
	Getenv(key string) string
	// HasEnvPrefix checks process environment names without exposing their values.
	HasEnvPrefix(prefix string) bool
	// EnvNames lists process environment names with prefix, never their values.
	EnvNames(prefix string) []string
	// IsRoot returns true if the process is running as root.
	IsRoot() bool
	// CurrentUser returns the current OS user.
	CurrentUser() (*user.User, error)
	// HomeDir returns the home directory for a given username.
	HomeDir(username string) (string, error)
	// Glob returns filenames matching a pattern.
	Glob(pattern string) ([]string, error)
	// EvalSymlinks resolves symbolic links in a path. Returns the resolved
	// canonical path. If the path is not a symlink, returns it unchanged.
	EvalSymlinks(path string) (string, error)
	// Readlink returns the stored target of the symlink (or Windows directory
	// junction) at path without following it — possibly relative, possibly an
	// NT-namespace spelling (\??\C:\...). A non-link path is an error.
	Readlink(path string) (string, error)
	// LoggedInUser returns the actual logged-in console user.
	// When running as root on macOS (e.g., via LaunchDaemon), this detects the
	// real console user via /dev/console rather than returning root.
	// Falls back to CurrentUser() when not root or on non-macOS platforms.
	LoggedInUser() (*user.User, error)
	// LoggedInUserContext is the deadline-aware form for budgeted probes.
	LoggedInUserContext(context.Context) (*user.User, error)
	// GOOS returns the runtime operating system.
	GOOS() string
	// IsAppleCLTStub reports whether binPath is an Apple Command Line Tools
	// shim (under /usr/bin/) that would trigger the macOS "install developer
	// tools" GUI prompt when invoked. Returns false on non-darwin systems, for
	// paths outside /usr/bin/, or when CLT is installed. Detectors must guard
	// every Run/RunWithTimeout on /usr/bin/-resolved binaries with this check
	// to avoid disrupting end users on machines without CLT installed.
	IsAppleCLTStub(ctx context.Context, binPath string) bool
	// DiskCapacityBytes returns the total bytes on the filesystem containing
	// path. Returns 0 on any error (lookup failures shouldn't block a scan).
	DiskCapacityBytes(path string) uint64
}

Executor defines the interface for all OS interactions. Every detector depends on this interface, enabling full unit-test coverage via mocks.

func NewUserAwareExecutor added in v1.10.0

func NewUserAwareExecutor(inner Executor, username string) Executor

NewUserAwareExecutor returns a wrapped executor that runs commands through the given user's login shell (rc files sourced for a full PATH) on Unix, in both deployment modes:

  • root (LaunchDaemon / MDM "Run Script"): RunAsUser sudo's to the user.
  • non-root (LaunchAgent's periodic fire): RunAsUser runs as the current user.

launchd hands both a stripped PATH, so package managers (brew/pip3/npm via nvm/fnm/homebrew/npm-global) need the user's rc-sourced shell to be resolved. Passes through to the inner executor unchanged when username is empty or on Windows.

type Mock

type Mock struct {

	// DetachedCalls records StartDetached invocations, newest last.
	// StartDetachedErr makes every spawn fail.
	DetachedCalls    []string
	StartDetachedErr error
	// contains filtered or unexported fields
}

Mock implements Executor for unit testing.

func NewMock

func NewMock() *Mock

func (*Mock) CreateFileOnce added in v1.18.0

func (m *Mock) CreateFileOnce(path string, data []byte, _ os.FileMode) error

CreateFileOnce stores data unless path already exists.

func (*Mock) CurrentUser

func (m *Mock) CurrentUser() (*user.User, error)

func (*Mock) DirExists

func (m *Mock) DirExists(path string) bool

func (*Mock) DiskCapacityBytes added in v1.11.3

func (m *Mock) DiskCapacityBytes(path string) uint64

func (*Mock) EnvNames added in v1.18.0

func (m *Mock) EnvNames(prefix string) []string
func (m *Mock) EvalSymlinks(path string) (string, error)

func (*Mock) FileExists

func (m *Mock) FileExists(path string) bool

func (*Mock) GOOS

func (m *Mock) GOOS() string

func (*Mock) Getenv

func (m *Mock) Getenv(key string) string

func (*Mock) Glob

func (m *Mock) Glob(pattern string) ([]string, error)

func (*Mock) GuardedFiles added in v1.17.0

func (m *Mock) GuardedFiles(_ []string, _ func(string) string, _ int64) Executor

GuardedFiles retains the in-memory filesystem. Native guarded I/O is covered by real-filesystem tests; mocks never access the host filesystem.

func (*Mock) HasEnvPrefix added in v1.18.0

func (m *Mock) HasEnvPrefix(prefix string) bool

func (*Mock) HomeDir

func (m *Mock) HomeDir(_ string) (string, error)

func (*Mock) Hostname

func (m *Mock) Hostname() (string, error)

func (*Mock) IsAppleCLTStub added in v1.11.3

func (m *Mock) IsAppleCLTStub(_ context.Context, binPath string) bool

func (*Mock) IsRoot

func (m *Mock) IsRoot() bool

func (*Mock) LoggedInUser added in v1.9.2

func (m *Mock) LoggedInUser() (*user.User, error)

func (*Mock) LoggedInUserContext added in v1.19.0

func (m *Mock) LoggedInUserContext(ctx context.Context) (*user.User, error)

func (*Mock) LookPath

func (m *Mock) LookPath(name string) (string, error)

func (*Mock) ReadDir

func (m *Mock) ReadDir(path string) ([]os.DirEntry, error)

func (*Mock) ReadDirLimit added in v1.18.0

func (m *Mock) ReadDirLimit(path string, max int) ([]os.DirEntry, bool, error)

func (*Mock) ReadFile

func (m *Mock) ReadFile(path string) ([]byte, error)
func (m *Mock) Readlink(path string) (string, error)

func (*Mock) Run

func (m *Mock) Run(_ context.Context, name string, args ...string) (string, string, int, error)

func (*Mock) RunAsUser

func (m *Mock) RunAsUser(ctx context.Context, _ string, command string) (string, error)

func (*Mock) RunInDir added in v1.10.1

func (m *Mock) RunInDir(ctx context.Context, _ string, _ time.Duration, name string, args ...string) (string, string, int, error)

func (*Mock) RunWithTimeout

func (m *Mock) RunWithTimeout(ctx context.Context, _ time.Duration, name string, args ...string) (string, string, int, error)

func (*Mock) SetAppleCLTInstalled added in v1.11.3

func (m *Mock) SetAppleCLTInstalled(installed bool)

SetAppleCLTInstalled controls the value returned by IsAppleCLTStub. Default is false (CLT not installed → binaries in the appleCLTStubBinaries allowlist are reported as stubs; other /usr/bin/ paths are unaffected).

func (*Mock) SetCommand

func (m *Mock) SetCommand(stdout, stderr string, exitCode int, name string, args ...string)

func (*Mock) SetCommandError

func (m *Mock) SetCommandError(err error, name string, args ...string)

func (*Mock) SetDir

func (m *Mock) SetDir(path string)

func (*Mock) SetDirEntries

func (m *Mock) SetDirEntries(path string, entries []os.DirEntry)

func (*Mock) SetDiskCapacityBytes added in v1.11.3

func (m *Mock) SetDiskCapacityBytes(path string, bytes uint64)

SetDiskCapacityBytes stubs the result of DiskCapacityBytes(path).

func (*Mock) SetEnv

func (m *Mock) SetEnv(key, value string)

func (*Mock) SetExecutable added in v1.18.0

func (m *Mock) SetExecutable(path string)

SetExecutable registers `path` as an existing executable file (mode 0755) so Stat-based lookups (UserAwareExecutor.LookPath's native PATH walk) can resolve it.

func (*Mock) SetFile

func (m *Mock) SetFile(path string, content []byte)

func (*Mock) SetFileInfo

func (m *Mock) SetFileInfo(path string, info os.FileInfo)

func (*Mock) SetFileMtime added in v1.13.0

func (m *Mock) SetFileMtime(path string, unixSec int64)

SetFileMtime registers a stat result for `path` with a custom mtime (Unix seconds) AND marks the file as existing (FileExists returns true). Useful for cache-invalidation tests that need to assert behavior across mtime windows.

func (*Mock) SetGOOS added in v1.9.2

func (m *Mock) SetGOOS(goos string)

func (*Mock) SetGlob

func (m *Mock) SetGlob(pattern string, matches []string)

func (*Mock) SetHomeDir

func (m *Mock) SetHomeDir(h string)

func (*Mock) SetHostname

func (m *Mock) SetHostname(h string)

func (*Mock) SetIsRoot

func (m *Mock) SetIsRoot(v bool)

func (*Mock) SetLoggedInUserError added in v1.11.3

func (m *Mock) SetLoggedInUserError(err error)

SetLoggedInUserError makes LoggedInUser return (nil, err). Pass nil to reset to default behavior (delegating to CurrentUser).

func (*Mock) SetPath

func (m *Mock) SetPath(name, path string)
func (m *Mock) SetReadlink(path, target string)

SetReadlink stubs the stored target Readlink(path) returns (relative, or a junction's \??\ spelling). Without it Readlink falls back to the SetSymlink target, so a plain symlink fixture needs only one call.

func (m *Mock) SetSymlink(path, target string)

SetSymlink stubs a symlink resolution: EvalSymlinks(path) -> target. If a path is not registered, EvalSymlinks returns the path unchanged (matching the behavior of filepath.EvalSymlinks on a non-symlink).

func (*Mock) SetSymlinkError added in v1.14.0

func (m *Mock) SetSymlinkError(path string, err error)

SetSymlinkError makes EvalSymlinks(path) return (", err), simulating a dangling or unresolvable symlink. Takes precedence over any SetSymlink stub.

func (*Mock) SetUsername

func (m *Mock) SetUsername(u string)

func (*Mock) StartDetached added in v1.17.0

func (m *Mock) StartDetached(name string, args ...string) error

DetachedCalls records every StartDetached invocation as "name arg arg ...", so a test can assert what the WSL-scan phase launched without running it. StartDetachedErr, when set, fails every spawn.

func (*Mock) Stat

func (m *Mock) Stat(path string) (os.FileInfo, error)

func (*Mock) WriteFileAtomic added in v1.18.0

func (m *Mock) WriteFileAtomic(path string, data []byte, _ os.FileMode) error

WriteFileAtomic stores data so ReadFile returns it.

type Real

type Real struct {
	// contains filtered or unexported fields
}

Real implements Executor using actual OS calls.

func NewReal

func NewReal() *Real

func (*Real) CreateFileOnce added in v1.18.0

func (r *Real) CreateFileOnce(path string, data []byte, perm os.FileMode) error

CreateFileOnce publishes a complete file at path only if none exists (hard link, so concurrent creators can't clobber each other); otherwise it returns an error matching os.ErrExist. Not part of Executor; callers type-assert.

func (*Real) CurrentUser

func (r *Real) CurrentUser() (*user.User, error)

func (*Real) DirExists

func (r *Real) DirExists(path string) bool

func (*Real) DiskCapacityBytes added in v1.11.3

func (r *Real) DiskCapacityBytes(path string) uint64

func (*Real) EnvNames added in v1.18.0

func (r *Real) EnvNames(prefix string) []string
func (r *Real) EvalSymlinks(path string) (string, error)

func (*Real) FileExists

func (r *Real) FileExists(path string) bool

func (*Real) GOOS

func (r *Real) GOOS() string

func (*Real) Getenv

func (r *Real) Getenv(key string) string

func (*Real) Glob

func (r *Real) Glob(pattern string) ([]string, error)

func (*Real) GuardedFiles added in v1.17.0

func (r *Real) GuardedFiles(roots []string, guard func(string) string, maxReadBytes int64) Executor

func (*Real) HasEnvPrefix added in v1.18.0

func (r *Real) HasEnvPrefix(prefix string) bool

func (*Real) HomeDir

func (r *Real) HomeDir(username string) (string, error)

func (*Real) Hostname

func (r *Real) Hostname() (string, error)

func (*Real) IsAppleCLTStub added in v1.11.3

func (r *Real) IsAppleCLTStub(_ context.Context, binPath string) bool

IsAppleCLTStub reports whether binPath is an Apple Command Line Tools shim that would trigger the macOS "install developer tools" GUI prompt when invoked. Returns true iff:

  1. GOOS is darwin,
  2. binPath is a known Apple CLT shim (see appleCLTStubBinaries), AND
  3. Xcode Command Line Tools are not installed (`xcode-select -p` fails).

The CLT-presence result is cached per Real instance via sync.Once. The probe deliberately uses context.Background() (with its own 5 s timeout) rather than the caller-provided ctx: sync.Once consumes the slot on the first call, so a caller arriving with a canceled or near-deadline ctx could otherwise poison the cache with cltPresent=false and make every subsequent check treat real binaries as stubs. The caller's ctx is retained in the signature for symmetry with the Executor interface.

`xcode-select -p` itself does NOT trigger the install prompt — it just prints the developer-dir path or exits non-zero when CLT is absent.

func (*Real) IsRoot

func (r *Real) IsRoot() bool

func (*Real) LoggedInUser added in v1.9.2

func (r *Real) LoggedInUser() (*user.User, error)

func (*Real) LoggedInUserContext added in v1.19.0

func (r *Real) LoggedInUserContext(ctx context.Context) (*user.User, error)

LoggedInUserContext bounds both the console probe and directory lookup by the caller's deadline. The default cap also applies when no deadline was supplied.

func (*Real) LookPath

func (r *Real) LookPath(name string) (string, error)

func (*Real) ReadDir

func (r *Real) ReadDir(path string) ([]os.DirEntry, error)

func (*Real) ReadDirLimit added in v1.18.0

func (r *Real) ReadDirLimit(path string, max int) ([]os.DirEntry, bool, error)

func (*Real) ReadFile

func (r *Real) ReadFile(path string) ([]byte, error)
func (r *Real) Readlink(path string) (string, error)

func (*Real) Run

func (r *Real) Run(ctx context.Context, name string, args ...string) (string, string, int, error)

func (*Real) RunAsUser

func (r *Real) RunAsUser(ctx context.Context, username, command string) (string, error)

func (*Real) RunInDir added in v1.10.1

func (r *Real) RunInDir(ctx context.Context, dir string, timeout time.Duration, name string, args ...string) (string, string, int, error)

func (*Real) RunWithTimeout

func (r *Real) RunWithTimeout(ctx context.Context, timeout time.Duration, name string, args ...string) (string, string, int, error)

func (*Real) StartDetached added in v1.17.0

func (r *Real) StartDetached(name string, args ...string) error

StartDetached starts the process and lets it go. It deliberately does not Wait: the child must outlive this process.

detachAttrs supplies platform creation flags that keep the child from being reaped with this process, most isolated first, falling back because job breakaway fails outright when the job forbids it. See detach_windows.go: a plain spawn was not observed to fail, so those flags are insurance against a silent failure mode rather than a fix for a measured one.

Release drops our handle afterwards so nothing here holds the child.

func (*Real) Stat

func (r *Real) Stat(path string) (os.FileInfo, error)

func (*Real) WriteFileAtomic added in v1.18.0

func (r *Real) WriteFileAtomic(path string, data []byte, perm os.FileMode) error

WriteFileAtomic replaces path via a synced temp file and rename, so readers never see a partial file. A missing parent is created world-traversable. Not part of Executor; callers type-assert for it.

type UserAwareExecutor added in v1.10.0

type UserAwareExecutor struct {
	// contains filtered or unexported fields
}

UserAwareExecutor wraps an Executor and delegates LookPath/Run/RunWithTimeout/ RunInDir to the logged-in user's login shell (with rc files sourced for a full PATH). This ensures commands like "brew list", "pip3 list", "npm --version" execute in the user's context with their real PATH — whether the agent runs as root (sudo to the user) or as the user itself under a LaunchAgent. launchd strips PATH in both cases, so package managers installed via nvm/fnm/homebrew aren't found by a bare exec.

All other Executor methods are forwarded unchanged.

func (*UserAwareExecutor) CurrentUser added in v1.10.0

func (e *UserAwareExecutor) CurrentUser() (*user.User, error)

func (*UserAwareExecutor) DirExists added in v1.10.0

func (e *UserAwareExecutor) DirExists(path string) bool

func (*UserAwareExecutor) DiskCapacityBytes added in v1.11.3

func (e *UserAwareExecutor) DiskCapacityBytes(path string) uint64

func (*UserAwareExecutor) EnvNames added in v1.18.0

func (e *UserAwareExecutor) EnvNames(prefix string) []string

EnvNames observes only this process; it never sources the user's shell.

func (e *UserAwareExecutor) EvalSymlinks(path string) (string, error)

func (*UserAwareExecutor) FileExists added in v1.10.0

func (e *UserAwareExecutor) FileExists(path string) bool

func (*UserAwareExecutor) GOOS added in v1.10.0

func (e *UserAwareExecutor) GOOS() string

func (*UserAwareExecutor) Getenv added in v1.10.0

func (e *UserAwareExecutor) Getenv(key string) string

func (*UserAwareExecutor) Glob added in v1.10.0

func (e *UserAwareExecutor) Glob(pattern string) ([]string, error)

func (*UserAwareExecutor) GuardedFiles added in v1.17.0

func (e *UserAwareExecutor) GuardedFiles(roots []string, guard func(string) string, maxReadBytes int64) Executor

func (*UserAwareExecutor) HasEnvPrefix added in v1.18.0

func (e *UserAwareExecutor) HasEnvPrefix(prefix string) bool

HasEnvPrefix observes only this process; it never sources the user's shell.

func (*UserAwareExecutor) HomeDir added in v1.10.0

func (e *UserAwareExecutor) HomeDir(username string) (string, error)

func (*UserAwareExecutor) Hostname added in v1.10.0

func (e *UserAwareExecutor) Hostname() (string, error)

func (*UserAwareExecutor) IsAppleCLTStub added in v1.11.3

func (e *UserAwareExecutor) IsAppleCLTStub(ctx context.Context, binPath string) bool

func (*UserAwareExecutor) IsRoot added in v1.10.0

func (e *UserAwareExecutor) IsRoot() bool

func (*UserAwareExecutor) LoggedInUser added in v1.10.0

func (e *UserAwareExecutor) LoggedInUser() (*user.User, error)

func (*UserAwareExecutor) LoggedInUserContext added in v1.19.0

func (e *UserAwareExecutor) LoggedInUserContext(ctx context.Context) (*user.User, error)

func (*UserAwareExecutor) LookPath added in v1.10.0

func (e *UserAwareExecutor) LookPath(name string) (string, error)

LookPath resolves name against the user's login-shell $PATH natively (stat + executable bit) instead of a `which` login shell per tool. Each of those re-sourced the user's rc files, where zsh compinit can block on its interactive "insecure directories" prompt. Aliases and shell functions are deliberately not matched: the agent needs a real executable. Falls back to `which` when the PATH fetch failed.

func (*UserAwareExecutor) ReadDir added in v1.10.0

func (e *UserAwareExecutor) ReadDir(path string) ([]os.DirEntry, error)

func (*UserAwareExecutor) ReadDirLimit added in v1.18.0

func (e *UserAwareExecutor) ReadDirLimit(path string, max int) ([]os.DirEntry, bool, error)

func (*UserAwareExecutor) ReadFile added in v1.10.0

func (e *UserAwareExecutor) ReadFile(path string) ([]byte, error)
func (e *UserAwareExecutor) Readlink(path string) (string, error)

func (*UserAwareExecutor) Run added in v1.10.0

func (e *UserAwareExecutor) Run(ctx context.Context, name string, args ...string) (string, string, int, error)

func (*UserAwareExecutor) RunAsUser added in v1.10.0

func (e *UserAwareExecutor) RunAsUser(ctx context.Context, username, command string) (string, error)

func (*UserAwareExecutor) RunInDir added in v1.10.1

func (e *UserAwareExecutor) RunInDir(ctx context.Context, dir string, timeout time.Duration, name string, args ...string) (string, string, int, error)

func (*UserAwareExecutor) RunWithTimeout added in v1.10.0

func (e *UserAwareExecutor) RunWithTimeout(ctx context.Context, timeout time.Duration, name string, args ...string) (string, string, int, error)

func (*UserAwareExecutor) StartDetached added in v1.17.0

func (e *UserAwareExecutor) StartDetached(name string, args ...string) error

StartDetached delegates: a detached spawn carries no user-impersonation concern of its own, and the WSL relay it launches already runs as the distro's default user.

func (*UserAwareExecutor) Stat added in v1.10.0

func (e *UserAwareExecutor) Stat(path string) (os.FileInfo, error)

Jump to

Keyboard shortcuts

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