Testing the memory safe Rust implementation of Sudo/Su

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. sudo-rs

    A memory safe implementation of sudo and su.

    The dependency list[0] looks pretty reasonable, AFAICT the overwhelming majority of that line-of-code count comes from autogenerated Windows API methods.

    [0]: https://github.com/memorysafety/sudo-rs/blob/60985b2f5f7ffa8...

  2. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  3. OpenDoas

    A portable fork of the OpenBSD `doas` command

    If you want to move away from Sudo, but don't want to try this rust implementation just yet, I have had great success with OpenBSD's doas. It has been ported to every Linux distro I know of as well:

    https://github.com/Duncaen/OpenDoas

  4. doas

    A port of OpenBSD's doas which runs on FreeBSD, Linux, NetBSD, and illumos

    There's also a straight port of doas:

    https://github.com/slicer69/doas/

    However unlike sudo and opendoas this does not implement the persist feature on not-OpenBSD.

  5. Cargo

    The Rust package manager

    You're probably running into this: https://github.com/rust-lang/cargo/issues/7058

    `cargo vendor` will download dependencies for all platforms, which leads to a lot of unused code being pulled in. In this case, the Windows API and Microsoft compiler wrappers.

    In this instance, during the build process "tempfile" is used as a dev-dependency, which has a runtime dependency on windows-sys when compiling Windows binaries. I'm not entirely sure why (commenting it out in Cargo.toml doesn't seem to break the build).

    After commenting it out and manually removing the spurious Windows API files as well as the unrelated packages (ctor diff output_vt100 pretty_assertions proc-macro2 quote syn unicode-ident yansi), I get the following results:

              0.0358 secs

  6. sudo

    Utility to execute a command as another user

    └───────────────────────────────────────────────────────────────────────────────────────┘

    As a comparison, this is the output for https://github.com/sudo-project/sudo:

           0.0439 secs

  7. tempfile

    Temporary file library for rust

    The sudo-rs Cargo.toml [1] file seems very reasonable. This is the curse of being cross platform. The inclusion of https://github.com/Stebalien/tempfile as a dependency is responsible for the overwhelming majority of lines due to including *-sys crates for multiple OSs.

    ~/Code/tempfile !! tokei vendor

  8. sudo

    Utility to execute a command as another user (by millert)

    I'm not sure, I only see static analysis and fuzzing workflows in the CI on GitHub [1].

    [1] https://github.com/millert/sudo/actions

  9. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Automated Testing With Rust

    1 project | dev.to | 9 Nov 2024
  • Adding automated tests to rost_gen

    2 projects | dev.to | 11 Nov 2022
  • Is this safe? Keeping and opening temporary file.

    2 projects | /r/rust | 27 May 2022
  • How can I test this get_type_filepaths function?

    1 project | /r/learnrust | 24 May 2022
  • How to open a PDF with default PDF viewer?

    2 projects | /r/rust | 22 May 2022