[][src]Crate redox_users

redox-users is designed to be a small, low-ish level interface to system user and group information, as well as user password authentication.

Permissions

Because this is a system level tool dealing with password authentication, programs are often required to run with escalated priveleges. The implementation of the crate is privelege unaware. The only privelege requirements are those laid down by the system administrator over these files:

  • /etc/group
    • Read: Required to access group information
    • Write: Required to change group information
  • /etc/passwd
    • Read: Required to access user information
    • Write: Required to change user information
  • /etc/shadow
    • Read: Required to authenticate users
    • Write: Required to set user passwords

Reimplementation

This crate is designed to be as small as possible without sacrificing critical functionality. The idea is that a small enough redox-users will allow easy re-implementation based on the same flexible API. This would allow more complicated authentication schemes for redox in future without breakage of existing software.

Structs

AllGroups

AllGroups provides (borrowed) access to all groups on the system. Note that this struct implements All, for a bunch of convenience functions.

AllUsers

AllUsers provides (borrowed) access to all the users on the system. Note that this struct implements All for a bunch of convenient access functions.

Config

A generic configuration that allows better control of AllUsers or AllGroups than might otherwise be possible.

Group

A struct representing a Redox user group. Currently maps to an /etc/group file entry.

User

A struct representing a Redox user. Currently maps to an entry in the /etc/passwd file.

Enums

UsersError

Errors that might happen while using this crate

Traits

All

This trait is used to remove repetitive API items from AllGroups and AllUsers. It uses a hidden trait so that the implementations of functions can be implemented at the trait level. Do not try to implement this trait.

Functions

get_egid

Gets the current process effective group ID.

get_euid

Gets the current process effective user ID.

get_gid

Gets the current process real group ID.

get_uid

Gets the current process real user ID.

Type Definitions

Result