README.md 935 Bytes
Newer Older
Jose Narvaez's avatar
Jose Narvaez committed
1
2
# users

Jose Narvaez's avatar
Jose Narvaez committed
3
Redox OS APIs for accessing users and groups information.
Jose Narvaez's avatar
Jose Narvaez committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

High level APIs for things like:

- Getting the current process effective user ID.
- Getting the current process user ID.
- Getting the current process effective group ID.
- Getting the current process group ID.
- Getting the user information for a given user ID.
- Getting the group information for a given group ID.
- Getting the user information for a given username.
- Getting a group information for a given group name.

We recommend to user these APIs instead of directly manipulating
`/etc/group` and `etc/passwd` as this is an implementation detail and
might change in the future.

## Using users

Make sure you have Rust nightly.

Add `rust_users` to `Cargo.toml`:

```toml
[dependencies.ralloc]
git = "https://github.com/redox-os/users.git"
```

then import it in your main file:

```rust
extern crate rust_users;
```

Jose Narvaez's avatar
Jose Narvaez committed
37
And `rust_users` is now ready to roll!