@@ -31,28 +31,45 @@ can print to `stdout` in a supported format to be used with NSS.
31
31
32
32
### Compatibility notes
33
33
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
35
43
- 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.
38
47
- To request support for a different configuration, please create a GitHub Issue
39
48
40
49
### Installation steps
41
50
42
51
1 . Prepare the commands/software that will be triggered by ` libnss_shim ` (see the Commands section for details).
43
52
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
45
58
```
46
- wget https://github.com/xenago/libnss_shim/releases/download/1.0.5/libnss_shim_1.0.5_amd64.deb
59
+ **RPM:**
47
60
```
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`.
48
65
49
- 3. Install it directly with `dpkg` or through `apt`:
66
+ **deb:**
50
67
```
51
- sudo dpkg -i libnss_shim_1.0.5_amd64 .deb
68
+ sudo dpkg -i libnss_shim_1.1.0_amd64 .deb
52
69
```
53
- or
70
+ **RPM:**
54
71
```
55
- sudo apt install ./libnss_shim_1.0.5_amd64.deb
72
+ sudo rpm -i ./libnss_shim-1.1.0-1.x86_64.rpm
56
73
```
57
74
58
75
4. Configure the shim by importing a custom `config.json`:
@@ -328,11 +345,34 @@ testing purposes. Environment variables are generally private, whereas commands/
328
345
Commands are not passed through a shell for execution. Although it is possible to run software like `bash`
329
346
with `libnss_shim`, using a shell is not recommended as this comes with additional risks such as command injection.
330
347
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
+
331
369
## Useful resources
332
370
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*
334
374
- 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*
336
376
- The GNU C [library](https://www.gnu.org/software/libc/manual/html_node/Actions-in-the-NSS-configuration.html)
337
377
- Rust bindings for `libnss`
338
378
- 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
342
382
- The `nss-wiregarden` [crate](https://crates.io/crates/libnss-wiregarden)
343
383
- Example of parsing `passwd` and `group` formats with Rust
344
384
- The `parsswd` [crate](https://crates.io/crates/parsswd)
345
- - Testing NSS modules in glibc
385
+ - * Testing NSS modules in glibc*
346
386
- 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)
348
388
- 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)
350
390
- MIT Debathena [website](https://debathena.mit.edu/hacks)
351
391
- Debathena NSS module source example
352
392
- MIT Debathena [repository](https://debathena.mit.edu/packages/debathena/libnss-afspag/libnss-afspag-1.0/)
0 commit comments