5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-12-22 18:45:40 +00:00
yggdrasil-go/cmd/yggdrasil
Klemens Nanni c22a746a1d
Rewrite chuser() for simplicity and correctness (#1203)
- Use unambiguous variable names (w/o package name conflict).
- Fail on invalid input such as the empty string or `:`.
- Do not change group without user, i.e. fail on `:group`.
- Parse input using mnemonic APIs.
- Do not juggle between integer types.
- Unset supplementary groups.
- Use set[ug]id(2) to follow the idiom of OpenBSD base programs.
  (cannot use setres[ug]id(2) as macOS does not have them.)

Includes/Supersedes #1202.
Fixes #927.

I only tested on OpenBSD (so far), but other systems should just work.
2024-11-17 21:37:07 +00:00
..
chuser_other.go argument to change uid/gid (#927) 2024-09-22 15:46:54 +00:00
chuser_unix_test.go Rewrite chuser() for simplicity and correctness (#1203) 2024-11-17 21:37:07 +00:00
chuser_unix.go Rewrite chuser() for simplicity and correctness (#1203) 2024-11-17 21:37:07 +00:00
main.go Reusable peer lookup/dial logic 2024-11-17 21:14:54 +00:00