Rename the executable from slocker_lite to slocker-lite
Matches the project name and the slocker-lite-priv-drop helper's own naming convention. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gv3s5jckJKzh6JkMoi2Akz
This commit is contained in:
@@ -66,15 +66,15 @@ Source layout (all under `src/`):
|
||||
`executable()` target in `meson.build`, **built with `-static`**). Deliberately
|
||||
has zero dependencies on the rest of this project (no fmt/spdlog/etc.) and is
|
||||
fully statically linked: it gets bind-mounted *into the container image's own
|
||||
filesystem*, which won't have `slocker_lite`'s own shared library dependencies —
|
||||
filesystem*, which won't have `slocker-lite`'s own shared library dependencies —
|
||||
a dynamically linked binary bind-mounted that way fails outright ("error while
|
||||
loading shared libraries"), which is exactly what happened before this was split
|
||||
out (the original approach bind-mounted `slocker_lite`'s own — dynamically linked
|
||||
out (the original approach bind-mounted `slocker-lite`'s own — dynamically linked
|
||||
— binary via `/proc/self/exe` and reexeced it; kept only as a lesson, not as
|
||||
working code). Usage: `slocker-lite-priv-drop <uid>:<gid> -- <command> [args...]`;
|
||||
does `setgroups(0,…)` → `setgid()` → `setuid()` → `execvp()`, in that order
|
||||
(dropping the group needs `CAP_SETGID`, which is lost once `setuid()` drops root).
|
||||
`find_priv_drop_helper()` (`src/bwrap.cpp`) locates it next to `slocker_lite`'s own
|
||||
`find_priv_drop_helper()` (`src/bwrap.cpp`) locates it next to `slocker-lite`'s own
|
||||
binary (via `/proc/self/exe`'s directory), which holds both when run straight from
|
||||
`buildDir/` and after a real `meson install`.
|
||||
- `user_spec.{h,cpp}` — `resolve_user_and_group()` resolves a user/group spec (each
|
||||
@@ -92,7 +92,7 @@ Source layout (all under `src/`):
|
||||
run). Also `find_in_path()`, a shared `$PATH` lookup. `run_process_foreground()`
|
||||
installs a SIGINT/SIGTERM handler around its `waitpid()` that forwards the signal
|
||||
to the running child and keeps waiting instead of letting the default disposition
|
||||
kill `slocker_lite` itself — without this, Ctrl-C (or `kill`) during `-r`'s `bwrap`
|
||||
kill `slocker-lite` itself — without this, Ctrl-C (or `kill`) during `-r`'s `bwrap`
|
||||
run would skip `run_container()`'s unmount/cleanup entirely, leaving the layer
|
||||
imported and/or mounted.
|
||||
|
||||
@@ -125,7 +125,7 @@ Build directory is `buildDir/` (already configured).
|
||||
- Build: `meson compile -C buildDir` (or `ninja -C buildDir`) — also builds
|
||||
`buildDir/slocker-lite-priv-drop`, the statically-linked helper `-r --user` needs
|
||||
(see `priv_drop_helper.cpp` in "Project state")
|
||||
- Run the executable: `./buildDir/slocker_lite -m <image.tar>` (see `--help` for the
|
||||
- Run the executable: `./buildDir/slocker-lite -m <image.tar>` (see `--help` for the
|
||||
full flag list: `-m/--mount`, `-r/--run`, `-u/--umount`, `-c/--cleanup`,
|
||||
`-l/--list-images`, `-n/--no-nsenter`, `--user`, `--group`, `-t/--test`,
|
||||
`--log-level`, `-h/--help`, `-V/--version`)
|
||||
@@ -146,4 +146,4 @@ Build directory is `buildDir/` (already configured).
|
||||
## Build configuration notes
|
||||
|
||||
- `meson.build` sets `warning_level=3` and `cpp_std=c++20` — keep new code warning-clean under `-Wall -Wextra -Wpedantic`-equivalent settings.
|
||||
- The single Meson `test()` target runs `slocker_lite` against a fixture OCI image tar generated at build time by `tests/gen_fixture.py` (a `custom_target`) and checks its exit code (no test framework is wired in yet).
|
||||
- The single Meson `test()` target runs `slocker-lite` against a fixture OCI image tar generated at build time by `tests/gen_fixture.py` (a `custom_target`) and checks its exit code (no test framework is wired in yet).
|
||||
|
||||
Reference in New Issue
Block a user