@@ -31,28 +31,45 @@ can print to `stdout` in a supported format to be used with NSS.
3131
3232### Compatibility notes
3333
34- - Tested on Debian-based GNU/Linux distributions
34+ - Tested on:
35+ - CentOS 7
36+ - AlmaLinux 8
37+ - AlmaLinux 9
38+ - Debian 11
39+ - Debian 12
40+ - Ubuntu 20.04
41+ - Ubuntu 22.04
42+ - Ubuntu 24.04
3543- Builds for ` amd64 ` architecture
36- - If ` .deb ` packages are not supported on the desired target platform, ` libnss_shim ` might be usable if the ` assets ` as
37- described in ` Cargo.toml ` are installed prior to running the ` debian/postinst ` script, but this has not been tested
44+ - Packaged in ` .deb ` and ` .rpm ` formats
45+ - If available packages do not work on a target platform, ` libnss_shim ` might be usable if the ` assets ` are installed
46+ as described in ` Cargo.toml ` prior to running the ` debian/postinst ` script, but this has not been tested extensively.
3847- To request support for a different configuration, please create a GitHub Issue
3948
4049### Installation steps
4150
42511 . Prepare the commands/software that will be triggered by ` libnss_shim ` (see the Commands section for details).
4352
44- 2 . Download the latest release produced by GitHub Actions:
53+ 2 . Download the latest release produced by GitHub Actions.
54+
55+ ** deb:**
56+ ```
57+ wget https://github.com/xenago/libnss_shim/releases/download/1.1.0/libnss_shim_1.1.0_amd64.deb
4558 ```
46- wget https://github.com/xenago/libnss_shim/releases/download/1.0.5/libnss_shim_1.0.5_amd64.deb
59+ **RPM:**
4760 ```
61+ wget https://github.com/xenago/libnss_shim/releases/download/1.1.0/libnss_shim-1.1.0-1.x86_64.rpm
62+ ```
63+
64+ 3. Install it directly `dpkg` or `rpm`.
4865
49- 3. Install it directly with `dpkg` or through `apt`:
66+ **deb:**
5067 ```
51- sudo dpkg -i libnss_shim_1.0.5_amd64 .deb
68+ sudo dpkg -i libnss_shim_1.1.0_amd64 .deb
5269 ```
53- or
70+ **RPM:**
5471 ```
55- sudo apt install ./libnss_shim_1.0.5_amd64.deb
72+ sudo rpm -i ./libnss_shim-1.1.0-1.x86_64.rpm
5673 ```
5774
58754. Configure the shim by importing a custom `config.json`:
@@ -328,11 +345,34 @@ testing purposes. Environment variables are generally private, whereas commands/
328345Commands are not passed through a shell for execution. Although it is possible to run software like `bash`
329346with `libnss_shim`, using a shell is not recommended as this comes with additional risks such as command injection.
330347
348+ ## Development
349+
350+ When building locally, using [`act`](https://github.com/nektos/act) can be helpful to run `.github/ci.yaml` directly.
351+ Depending on your configuration, some tweaks may be required to enable it to build successfully.
352+
353+ I generally find it easiest to run `build.sh` inside a temporary container:
354+
355+ 1. Ensure `Docker` is installed and available
356+ 2. Ensure `libnss_shim` is cloned:
357+
358+ git clone https://github.com/xenago/libnss_shim.git
359+
360+ 3. Run the build script inside a temporary container, setting `LIBNSS_SHIM_VERSION` and the cloned repo path as desired:
361+
362+ sudo docker run -e "LIBNSS_SHIM_VERSION=0.0.0" -v /path/to/cloned/libnss_shim:/libnss_shim --rm quay.io/pypa/manylinux2014_x86_64:latest bash /libnss_shim/build.sh
363+
364+ 4. The build script will output packages in the following subdirectories of the cloned repo:
365+
366+ * `target/debian/*.deb`
367+ * `target/generate-rpm/*.rpm`
368+
331369## Useful resources
332370
333- - NSS Modules Interface
371+ - *Building Rust binaries in CI that work with older GLIBC*
372+ - Jakub Beránek, AKA Kobzol's [blog](https://kobzol.github.io/rust/ci/2021/05/07/building-rust-binaries-in-ci-that-work-with-older-glibc.html)
373+ - *NSS Modules Interface*
334374 - The GNU C [library](https://www.gnu.org/software/libc/manual/html_node/NSS-Modules-Interface.html)
335- - Actions in the NSS configuration
375+ - * Actions in the NSS configuration*
336376 - The GNU C [library](https://www.gnu.org/software/libc/manual/html_node/Actions-in-the-NSS-configuration.html)
337377- Rust bindings for `libnss`
338378 - The `libnss` [crate](https://crates.io/crates/libnss)
@@ -342,11 +382,11 @@ with `libnss_shim`, using a shell is not recommended as this comes with addition
342382 - The `nss-wiregarden` [crate](https://crates.io/crates/libnss-wiregarden)
343383- Example of parsing `passwd` and `group` formats with Rust
344384 - The `parsswd` [crate](https://crates.io/crates/parsswd)
345- - Testing NSS modules in glibc
385+ - * Testing NSS modules in glibc*
346386 - Geoffrey Thomas's [blog](https://ldpreload.com/blog/testing-glibc-nsswitch)
347- - NSS - Debathena (useful description of NSS and how it fits into their architecture)
387+ - * NSS - Debathena* (useful description of NSS and how it fits into their architecture)
348388 - MIT Debathena [wiki](https://debathena.mit.edu/trac/wiki/NSS)
349- - Debathena hacks (links to more NSS-related code for their project)
389+ - * Debathena hacks* (links to more NSS-related code for their project)
350390 - MIT Debathena [website](https://debathena.mit.edu/hacks)
351391- Debathena NSS module source example
352392 - MIT Debathena [repository](https://debathena.mit.edu/packages/debathena/libnss-afspag/libnss-afspag-1.0/)
0 commit comments