{"id":51851212,"url":"https://github.com/lu-zero/pseudoroot","last_synced_at":"2026-07-23T19:30:35.987Z","repository":{"id":368783503,"uuid":"1283302394","full_name":"lu-zero/pseudoroot","owner":"lu-zero","description":"old-style fakeroot implementation","archived":false,"fork":false,"pushed_at":"2026-07-02T06:16:30.000Z","size":322,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-07-02T08:14:00.268Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lu-zero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-06-28T19:20:31.000Z","updated_at":"2026-07-02T06:16:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lu-zero/pseudoroot","commit_stats":null,"previous_names":["lu-zero/pseudoroot"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/lu-zero/pseudoroot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lu-zero%2Fpseudoroot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lu-zero%2Fpseudoroot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lu-zero%2Fpseudoroot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lu-zero%2Fpseudoroot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lu-zero","download_url":"https://codeload.github.com/lu-zero/pseudoroot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lu-zero%2Fpseudoroot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35814999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-23T02:00:06.683Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-23T19:30:35.519Z","updated_at":"2026-07-23T19:30:35.982Z","avatar_url":"https://github.com/lu-zero.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pseudoroot\n\n[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE-MIT)\n[![Build Status](https://github.com/lu-zero/pseudoroot/workflows/CI/badge.svg)](https://github.com/lu-zero/pseudoroot/actions?query=workflow:CI)\n[![codecov](https://codecov.io/gh/lu-zero/pseudoroot/graph/badge.svg)](https://codecov.io/gh/lu-zero/pseudoroot)\n[![Crates.io](https://img.shields.io/crates/v/pseudoroot.svg)](https://crates.io/crates/pseudoroot)\n[![dependency status](https://deps.rs/repo/github/lu-zero/pseudoroot/status.svg)](https://deps.rs/repo/github/lu-zero/pseudoroot)\n[![docs.rs](https://docs.rs/pseudoroot/badge.svg)](https://docs.rs/pseudoroot)\n\nA Rust implementation of fakeroot using library interposition\n(`LD_PRELOAD` on Linux, `DYLD_INSERT_LIBRARIES` on macOS). Commands run as\nif they had root privileges without requiring real root access.\n\n## Quick start\n\n```bash\ncargo install --path pseudoroot\n\n# Implicit run (fakeroot-style)\npdr -- id\n\n# Explicit subcommand form (equivalent)\npdr run -- id\npdr --uid 1000 --gid 1000 -- id\n```\n\n`pdr` is a single self-contained binary — the interposed library is embedded\nat build time and extracted to a cache directory on first use, so no\n`libpseudoroot_lib.so`/`.dylib` needs to exist anywhere on disk beforehand.\n`pdr start` runs the optional persistent daemon in-process, so no separate\n`pdrd` binary is needed for that either; a standalone `pdrd` is still\navailable (see [Build and test](#build-and-test)) as a dedicated daemon\nprocess for external orchestration.\n\n## CLI options\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--uid \u003cUID\u003e` | Fake UID | 0 |\n| `--gid \u003cGID\u003e` | Fake GID | 0 |\n| `--daemon` | Attach to an existing `pdrd` instead of a per-invocation session | off |\n| `--socket-path \u003cPATH\u003e` | Daemon socket path | `/tmp/pseudoroot.sock` |\n| `start` / `stop` / `status` | Manage the daemon | — |\n| `print-library-path` | Print the interposed library path | — |\n| `start --verbose` | Enable verbose daemon logging | off |\n| `start --cleanup` | Clean up socket file on daemon exit | off |\n\nBy default each invocation gets its own session, shared across `exec`\nwithin it. To share state across separate invocations, use a daemon:\n\n```bash\npdr start --socket-path /tmp/pseudoroot.sock   # daemon runs in-process\npdr --daemon --socket-path /tmp/pseudoroot.sock -- make install\npdr stop --socket-path /tmp/pseudoroot.sock\n```\n\n## Rust API (fakeroost-compatible)\n\nSwap backends by changing the import only:\n\n```rust\nuse pseudoroot::FakerootCommandExt;\n\nfn main() {\n    pseudoroot::init(); // required: handles session re-exec (no-op otherwise)\n    std::process::Command::new(\"make\")\n        .arg(\"install\")\n        .env(\"PSEUDOROOT_UID\", \"0\")\n        .env(\"PSEUDOROOT_GID\", \"0\")\n        .fakeroot()\n        .status()\n        .unwrap();\n}\n```\n\n## Environment variables\n\n- `PSEUDOROOT_UID` / `PSEUDOROOT_GID` — fake uid/gid (default: 0)\n- `PSEUDOROOT_DAEMON_SOCKET` — attach to an existing daemon (skips session auto-start)\n- `PSEUDOROOT_STANDALONE` — per-process state only (no session)\n- `PSEUDOROOT_SESSION_SHM` — set to `0` to use an in-process daemon thread instead of the shared-memory map for session mode\n- `PSEUDOROOT_LIB` — override the interposed library path, bypassing the\n  embedded copy entirely (tests, custom installs, debugging a locally built\n  `pseudoroot-lib`)\n\n## Documentation\n\n- [Architecture](docs/architecture.md) — crate and module map, state backends\n  (SHM session, daemon, standalone), session lifecycle, IPC protocol, SHM\n  layout, platform differences, and a guide for extending interposition.\n- [Benchmarks](docs/benchmarks.md) — comparison against native,\n  `fakeroot`, and `fakeroost`; on a 128-core Linux machine pseudoroot sustains\n  ~7.4M faked `stat()` calls/sec vs fakeroot's ~44.5K, and on a MacBook Pro\n  with M2 Max (12-core ARM64) ~899K calls/sec vs fakeroot's ~43K.\n\n## Comparison\n\n| Feature | pseudoroot | fakeroot | fakeroost |\n|---------|-----------|----------|-----------|\n| Mechanism | `LD_PRELOAD` | `LD_PRELOAD` | ptrace supervisor |\n| Platforms | Linux, macOS | Linux | Linux |\n| xattr / setcap | Faked | Faked | Faked |\n| mknod unprivileged | Placeholder + fake metadata | Yes | Yes |\n| Multi-process state | SHM session or daemon (`pdrd`) | `faked` | N/A (single run) |\n| Rust API | `FakerootCommandExt` | C only | `FakerootCommandExt` |\n\n## Build and test\n\n```bash\ncargo build\ncargo test\ncargo clippy --all-targets -- -D warnings\ncargo fmt --check\n```\n\n`pdr` embeds the interposed library at build time: `pseudoroot/build.rs`\ncompiles the cdylib from the source bundled at `pseudoroot/interpose/` and\n`include_bytes!`es it into the binary — so `cargo install pseudoroot` from\ncrates.io is self-contained, with no separate `.so`/`.dylib` to install.\nFor a standalone `pdrd` daemon binary, build the `pseudoroot-daemon` package\ndirectly: `cargo build -p pseudoroot-daemon`.\n\n## License\n\nLicensed under [MIT](LICENSE-MIT).\n\n## Contributing\n\nSee [AGENTS.md](./AGENTS.md) for conventions (Conventional Commits, style,\nMSRV checks).\n\n## Author\n\nLuca Barbato \u003clu_zero@gentoo.org\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flu-zero%2Fpseudoroot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flu-zero%2Fpseudoroot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flu-zero%2Fpseudoroot/lists"}