mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-12-19 06:27:32 +00:00
parent
7adf5f18b7
commit
657f7e0db3
@ -14,6 +14,12 @@ import (
|
||||
|
||||
func chuser(input string) error {
|
||||
givenUser, givenGroup, _ := strings.Cut(input, ":")
|
||||
if givenUser == "" {
|
||||
return fmt.Errorf("user is empty")
|
||||
}
|
||||
if strings.Index(input, ":") > -1 && givenGroup == "" {
|
||||
return fmt.Errorf("group is empty")
|
||||
}
|
||||
|
||||
var (
|
||||
err error
|
||||
|
@ -4,8 +4,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"os/user"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// Usernames must not contain a number sign.
|
||||
|
Loading…
x
Reference in New Issue
Block a user