https://github.com/ddosolitary/ld-audit-search-mod
Audit module that modifies ld.so library search behavior
https://github.com/ddosolitary/ld-audit-search-mod
glibc linker nix
Last synced: 4 months ago
JSON representation
Audit module that modifies ld.so library search behavior
- Host: GitHub
- URL: https://github.com/ddosolitary/ld-audit-search-mod
- Owner: DDoSolitary
- Created: 2024-07-19T11:29:09.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-01-24T18:56:35.000Z (5 months ago)
- Last Synced: 2025-01-24T19:22:08.498Z (5 months ago)
- Topics: glibc, linker, nix
- Language: C++
- Homepage:
- Size: 43 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Usage
```bash
# build the audit module
nix build .# point LD_AUDIT to the module
export LD_AUDIT=$PWD/result/lib/ld-audit-search-mod.so# set config file path
# see examples/config.yaml for documentation
export LD_AUDIT_SEARCH_MOD_CONFIG=/path/to/config.yaml# run your program
your-program
```# Use with NixOS
```nix
# flake.nix
{
inputs.lasm.url = "github:DDoSolitary/ld-audit-search-mod";
outputs = { nixpkgs, lasm }: {
nixosConfigurations.your-machine = nixpkgs.lib.nixosSystem {
modules = [
({ pkgs, ... }: {
nixpkgs.overlays = [ lasm.overlays.default ];
environment.sessionVariables = {
LD_AUDIT = "${pkgs.ld-audit-search-mod}/lib/libld-audit-search-mod.so";
LD_AUDIT_SEARCH_MOD_CONFIG = pkgs.writeText "lasm-config.yaml" (builtins.toJSON {
rules = [
{
cond.rtld = "nix";
libpath.save = true;
default.prepend = [
{ saved = "libpath"; }
{ dir = "${pkgs.stdenv.cc.cc.lib}/lib"; }
];
}
];
});
};
})
];
};
};
}
```