mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 14:15:06 +03:00
Rewrite chuser() for simplicity and correctness
- 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 setres[ug]id(2) to match the idiom of OpenBSD base programs. Includes/Supersedes #1202. Fixes #927. I only tested on OpenBSD (so far), hence the split, but other systems should just work.
This commit is contained in:
parent
75d2080e53
commit
a0bfd9da44
2 changed files with 59 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
|
||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
|
||||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || solaris
|
||||
// +build aix darwin dragonfly freebsd linux netbsd solaris
|
||||
|
||||
package main
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue