README.md 930 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
High level APIs for:
Jose Narvaez's avatar
Jose Narvaez committed
6
7
8
9
10
11
12
13
14
15

- 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.

16
We recommend to use these APIs instead of directly manipulating the
Jose Narvaez's avatar
Jose Narvaez committed
17
18
19
20
21
22
23
24
25
26
`/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
Jose Narvaez's avatar
Jose Narvaez committed
27
[dependencies.rust_users]
Jose Narvaez's avatar
Jose Narvaez committed
28
29
30
31
32
33
34
35
36
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!