Rust library to manipulate file system access control lists (ACL) on macOS, Linux, and FreeBSD

This module provides two high level functions, getfacl and setfacl

Exacl  

Rust library to manipulate file system access control lists (ACL) on macOS, Linux, and FreeBSD.

Example

use exacl::{getfacl, setfacl, AclEntry, Perm};

// Get the ACL from "./tmp/foo".
let mut acl = getfacl("./tmp/foo", None)?;

// Print the contents of the ACL.
for entry in &acl {
    println!("{}", entry);
}

// Add an ACL entry to the end.
acl.push(AclEntry::allow_user("some_user", Perm::READ, None));

// Set the ACL for "./tmp/foo".
setfacl(&["./tmp/foo"], &acl, None)?;

API

This module provides two high level functions, getfacl and setfacl.

  • getfacl retrieves the ACL for a file or directory.
  • setfacl sets the ACL for files or directories.

On Linux and FreeBSD, the ACL contains entries for the default ACL, if present.

Both getfacl and setfacl work with a Vec<AclEntry>. The AclEntry structure contains five fields:

  • kind : AclEntryKind - the kind of entry (User, Group, Other, Mask, or Unknown).
  • name : String - name of the principal being given access. You can use a user/group name, decimal uid/gid, or UUID (on macOS).
  • perms : Perm - permission bits for the entry.
  • flags : Flag - flags indicating whether an entry is inherited, etc.
  • allow : bool - true if entry is allowed; false means deny. Linux only supports allow=true.
Issues

Collection of the latest Issues

byllyfish

byllyfish

0

When using a custom io::Error, have the error kind reflect the type of error. In the following, there may be a more suitable kind than Other (like not found).

Err value: Custom { kind: Other, error: "entry 0: unknown user name: "pooh"" }'

Versions

Find the latest versions by id

v0.8.0 - Feb 04, 2022

  • serde is now an optional dependency. Use features = ["serde"] to enable (Issue #95).
  • Remove the num_enum dependency (PR #94, contributed by bjorn3).
  • Update example code to use clap 3.

v0.7.0 - Dec 25, 2021

  • Add the from_mode top level function.
  • Remove Acl (low level interface) from the public exported API.
  • Remove dependency on the nix crate.
  • Update version dependencies for bindgen and env_logger.
  • Update Rust edition from 2018 to 2021.

v0.6.0 - Jun 20, 2021

  • Fix new rust clippy warnings.
  • Update version dependencies for bindgen and nix.
  • Update valgrind suppressions used in testing.

v0.5.0 - Feb 22, 2021

  • Add support for NFSv4 ACL's on FreeBSD.
  • Remove support for platform-specific text formats.

v0.4.0 - Jan 14, 2021

  • Add support for symbolic links on FreeBSD.
  • Add support for ACCESS_ACL option to getfacl and setfacl.
  • Allow for - in permission abbreviation, e.g. r-x.
  • Update rust toolchain to latest stable version and fix clippy/lint issues.
  • Fix package metadata for docs.rs; improve platform-specific documentation.

v0.3.0 - Jan 03, 2021

  • Add support for Posix.1e ACLs on FreeBSD.
  • Add from_str and to_string top-level functions.
  • Remove the Acl::check function from public API.

v0.2.0 - Dec 22, 2020

  • Implement buildtime_bindgen feature; use prebuilt bindings by default.
  • Implement FromStr and Display for AclEntry.
  • Add to_writer and from_reader top-level functions for parsing text.

v0.1.1 - Dec 08, 2020

  • Fix docs build on docs.rs by including platform bindings for macos and linux.

v0.1.0 - Dec 07, 2020

  • Initial release.

Information - Updated Mar 14, 2022

Stars: 4
Forks: 1
Issues: 5

Repositories & Extras

Rust FUSE - Filesystem in Userspace

Rust library crate for easy implementation of Crate documentation

Rust FUSE - Filesystem in Userspace

Cross-platform filesystem notification library for Rust

Add file-system notifications via this library for Rust

Cross-platform filesystem notification library for Rust

Catfs is a caching filesystem written in Rust

Catfs allows you to have cached access to another (possibly remote)

Catfs is a caching filesystem written in Rust

a tool to analyze file system usage written in Rust

coloured output, according to the LS_COLORS environment variable

a tool to analyze file system usage written in Rust

Generate a filesystem tree from a macro or a YAML tree

When I write integration tests, I often find myself needing to create temporary files and directories

Generate a filesystem tree from a macro or a YAML tree

FUSE (Filesystem in Userspace) for Rust

FUSE-Rust is a FUSE filesystems in userspace

FUSE (Filesystem in Userspace) for Rust

The file system module for rCore OS

The file system module for uCore OS

The file system module for rCore OS

A file abstraction system for Rust

Chicon is a library meant to provide a simple, uniform and universal API interacting with any filesystem

A file abstraction system for Rust

Syncs folders into IPFS's mutable file system (the directory structure accessible through ipfs files &amp;hellip;)

Despite the name, FTP2MFS is capable of reading from FTP, HTTP directory listings, rsyncd, and the local filesystem

Syncs folders into IPFS's mutable file system (the directory structure accessible through ipfs files &amp;hellip;)

Raw Filesystem API for Rust — enable simpler browsing with ease

RFSAPI requests are made by setting a GET request's X-Raw-Filesystem-API header to 1

Raw Filesystem API for Rust — enable simpler browsing with ease
Facebook Instagram Twitter GitHub Dribbble
Privacy