README.md 1.07 KB
Newer Older
1
# redox_users
Jose Narvaez's avatar
Jose Narvaez committed
2

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

- 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.
15
- Iterating over all the users on the system.
16
17
18
19
- Iterating over all the groups on the system
- Adding a user
- Adding a group
- Getting an unused gid
Jose Narvaez's avatar
Jose Narvaez committed
20

21
We recommend to use these APIs instead of directly manipulating the
22
`/etc/group` and `/etc/passwd` as this is an implementation detail and
Jose Narvaez's avatar
Jose Narvaez committed
23
24
might change in the future.

25
## Using redox_users
Jose Narvaez's avatar
Jose Narvaez committed
26
27
28

Make sure you have Rust nightly.

29
Add `redox_users` to `Cargo.toml`:
Jose Narvaez's avatar
Jose Narvaez committed
30
31

```toml
32
[dependencies.redox_users]
Jose Narvaez's avatar
Jose Narvaez committed
33
34
35
36
37
38
git = "https://github.com/redox-os/users.git"
```

then import it in your main file:

```rust
39
extern crate redox_users;
Jose Narvaez's avatar
Jose Narvaez committed
40
41
```

42
And `redox_users` is now ready to roll!