12 releases

0.3.4 Oct 4, 2024
0.3.3+1.19.2 May 13, 2024
0.3.2+1.19.2 Jan 16, 2022
0.3.1+1.19.2 Dec 23, 2021
0.2.4+1.18.2 Jul 8, 2020

#621 in Database interfaces

Download history 7597/week @ 2024-08-17 9920/week @ 2024-08-24 11163/week @ 2024-08-31 8604/week @ 2024-09-07 6330/week @ 2024-09-14 8687/week @ 2024-09-21 9554/week @ 2024-09-28 7494/week @ 2024-10-05 8965/week @ 2024-10-12 7373/week @ 2024-10-19 6875/week @ 2024-10-26 8809/week @ 2024-11-02 6917/week @ 2024-11-09 7486/week @ 2024-11-16 9688/week @ 2024-11-23 5919/week @ 2024-11-30

31,903 downloads per month
Used in 9 crates (via sasl2-sys)

Apache-2.0

13MB
288K SLoC

C 252K SLoC // 0.2% comments PO File 8K SLoC // 0.4% comments Python 8K SLoC // 0.2% comments C++ 8K SLoC // 0.2% comments Perl 2K SLoC // 0.1% comments M4 2K SLoC // 0.3% comments ASN.1 1.5K SLoC // 0.2% comments GNU Style Assembly 1.5K SLoC Happy 1K SLoC INI 602 SLoC // 0.0% comments Bitbake 575 SLoC // 0.2% comments Shell 506 SLoC // 0.1% comments AWK 396 SLoC // 0.1% comments Visual Studio Project 338 SLoC Alex 245 SLoC Rust 181 SLoC // 0.2% comments SWIG 162 SLoC // 0.3% comments Emacs Lisp 104 SLoC // 0.3% comments Batch 69 SLoC Visual Studio Solution 60 SLoC

Contains (autotools obfuscated code, 520KB) krb5/src/configure, (obscure autoconf code, 50KB) krb5/src/configure.ac

rust-krb5-src

crates.io CI Rust Documentation

Rust build system integration for libkrb5, MIT's Kerberos implementation.

View documentation.

Installation

# Cargo.toml
[dependencies]
krb5-src = "0.3.4"

lib.rs:

Build system integration for libkrb5, MIT's Kerberos implementation.

This crate builds a vendored copy of libkrb5 using Cargo's support for custom build scripts. It is not intended for direct consumption, but as a dependency for other crates that need libkrb5 available, like sasl2-sys.

krb5-src is currently bundling libkrb5 v1.19.2.

To use this crate, declare a dependency or dev-dependency on krb5-src. Then, in the build script for your crate, the environment variable DEP_KRB5_SRC_ROOT will point to the directory in which the bundled copy of libkrb5 has been installed. You can build and link another C library against this copy of libkrb5, or generate Rust bindings and link Rust code against this copy of libkrb5.

Note that you are responsible for instructing Cargo to link in the components of libkrb5 that you depend upon. Here is an example build script fragment.

println!(
    "cargo:rustc-link-search=native={}",
    PathBuf::from(env::var("DEP_KRB5_SRC_ROOT").unwrap()).join("lib").display(),
);
println!("cargo:rustc-link-lib=static=gssapi_krb5");
println!("cargo:rustc-link-lib=static=krb5");
println!("cargo:rustc-link-lib=static=k5crypto");
println!("cargo:rustc-link-lib=static=com_err");
println!("cargo:rustc-link-lib=static=krb5support");

Cargo features

krb5-src can be configured with the following Cargo features:

  • binaries builds the binaries that come with libkrb5 (kinit, kdestroy, et al.) and installs them into DEP_KRB5_SRC_ROOT/bin.

  • nls enables native language support (i.e., localization). This feature corresponds to the --enable-nls configure flag.

    On some platforms, when this feature is enabled, the application must additionally link against libintl.

  • openssl-vendored enables the vendored feature of the openssl-sys crate.

Note that none of these features have any effect when compiling on Windows.

Platform support

krb5-src is tested on recent versions of Ubuntu, macOS, and Windows. Patches that improve support for other platforms are welcome.

Dependencies