Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rlee287/sock_trigger_cmd
https://github.com/rlee287/sock_trigger_cmd
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/rlee287/sock_trigger_cmd
- Owner: rlee287
- Created: 2022-07-27T01:22:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-12T05:21:39.000Z (9 months ago)
- Last Synced: 2024-12-24T01:15:15.419Z (11 days ago)
- Language: Rust
- Size: 54.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sock_trigger_cmd
`sock_trigger_cmd` listens to a Unix domain socket and maps null-separated keys into commands to execute. It is meant to allow for the execution of a limited set of commands and is not intended as a replacement for remote shells like SSH.
Commands are run directly (i.e. without a shell environment) and only have access to `HOME`, `PATH`, `USER`, `SHELL`, and `TERM`, although other environment variables can be specified in the usual way with the `VAR=VALUE cmd` syntax. If `sock_trigger_cmd` is run as root, commands can be run as other users using the `runuser` command.
The socket returns the following information for each command executed:
- "C" if the command ran to completion, "S" if the command was terminated by a signal, "F" if the command could not be spawned, and "X" for a non-matching key
- A single `u8` containing the exit code, if the previous byte was a "C"
- A single `u8` containing the signal number, if the previous byte was a "S"