|
|
|
@ -78,7 +78,7 @@ func AddUser(username string, uid string) error {
|
|
|
|
|
func AddGroup(name string, gid string) error {
|
|
|
|
|
_, err := user.LookupGroupId(gid)
|
|
|
|
|
if err != nil {
|
|
|
|
|
if _, ok := err.(*user.UnknownGroupError); ok {
|
|
|
|
|
if _, ok := err.(user.UnknownGroupIdError); ok {
|
|
|
|
|
cmd := exec.Command(
|
|
|
|
|
"groupadd",
|
|
|
|
|
"--gid", gid,
|
|
|
|
@ -88,7 +88,7 @@ func AddGroup(name string, gid string) error {
|
|
|
|
|
output, err := cmd.CombinedOutput()
|
|
|
|
|
if err != nil {
|
|
|
|
|
return fmt.Errorf(
|
|
|
|
|
"Error adding group: %w. Process error: %w. Process output: %s",
|
|
|
|
|
"Error adding group: %w. Process error: %s. Process output: %s",
|
|
|
|
|
ErrAddGroupFailExit,
|
|
|
|
|
err,
|
|
|
|
|
output,
|
|
|
|
@ -97,6 +97,8 @@ func AddGroup(name string, gid string) error {
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
log.Println(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return err
|
|
|
|
@ -424,7 +426,7 @@ func main() {
|
|
|
|
|
case "entrypoint":
|
|
|
|
|
err := EntryPoint(os.Args[2:])
|
|
|
|
|
if err != nil {
|
|
|
|
|
fmt.Println("error executing entrypoint command", err)
|
|
|
|
|
fmt.Println("error executing entrypoint command:", err)
|
|
|
|
|
os.Exit(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|