Page MenuHomeGitPull.it
Diviner Tech Docs PhabricatorSudoBinary

final class PhabricatorSudoBinary
Phorge Technical Documentation (Daemons)

Identify the "sudo" implementation on this host and format commands for it.

sudo-rs, the default on some newer distros, ignores the "-E" flag with a warning and runs the command with a reset environment. If we detect that it is running, we pass a "--preserve-env=..." list instead. Classic sudo writes the value of every listed variable to syslog, so we need to check which version of the binary is running rather than defaulting to --preserve-env across the board.

Methods

public static function newFromVersionOutput($path, $output)

This method is not documented.
Parameters
$path
$output
Return
wild

public static function loadForPath($path)

This method is not documented.
Parameters
$path
Return
wild

public function getPath()

This method is not documented.
Return
wild

public function getFlavor()

This method is not documented.
Return
wild

public function getVersion()

This method is not documented.
Return
wild

public function isUsable()

This method is not documented.
Return
wild

public function getUnusableReason()

This method is not documented.
Return
wild

public function formatCommand($user, $command, $env_keys)

This method is not documented.
Parameters
string$userUser to run the command as.
PhutilCommandString$commandCommand to run.
list<string>$env_keysVariables the command needs. Only sudo-rs uses this list; classic sudo preserves the whole environment.
Return
PhutilCommandString