Skip to content

Latest commit

 

History

History
82 lines (61 loc) · 3.38 KB

README.md

File metadata and controls

82 lines (61 loc) · 3.38 KB

sudo_plugin-sys

Build Status Docs Latest Version License

FFI definitions for the sudo_plugin(8) facility.

Sudo Plugin API Version

This crate matches its version to the upstream sudo_plugin(8) API version it implements and will use patch versions to indicate internal fixes to the crate.

Historically, the sudo_plugin(8) binary interface has been backwards-compatible with previous versions and respected semantic versioning practices. Since we track the upstream version numbering scheme, we believe this project can also respect semantic versioning but cannot make this a guarantee.

Later versions of this plugin should be backward-compatible with older versions of the sudo_plugin(8) interface. However, the user of this API is responsible for checking the sudo front-end API version before using certain features. Please consult the manpage to identify which features require version probing.

Building

This crate includes pregenerated bindings for x86, x86-64, and aarch64 architectures and will use them by default when building with Cargo.

cargo build

For other architectures, you'll need to build with the bindgen feature enabled. This will generate bindings from the copy of sudo_plugin.h bundled with this library.

cargo build --features bindgen

As releases of this library are built with a specific version of the plugin API in mind, we do not currently support building against external versions of this header. Since newer versions of the sudo plugin interface are binary-compatible with older versions (and vice versa), doing so should not be necessary. If you find a use-case that requires this, please let us know.

Usage

This project simply exposes the raw sudo plugin API bindings to Rust. While these raw FFI bindings may be used directly, we encourage the use of a safe wrapper such as the sudo_plugin project.

For a demonstration of how to use the raw FFI bindings directly, see the raw_plugin_api example project.

Contributions

Contributions are welcome!

As this project is operated under Square's open source program, new contributors will be asked to sign a contributor license agreement that ensures we can continue to develop, maintain, and release this project openly.

License

sudo_plugin-sys is distributed under the terms of the Apache License, Version 2.0.