Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: run image build with same permissions as finalize plugins #79

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions core/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package core

import (
"fmt"
"math"
"os"
"os/exec"
"syscall"
Expand Down Expand Up @@ -72,12 +71,6 @@ func compileDocker(recipe api.Recipe, gid int, uid int) error {
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Dir = recipe.ParentPath
cmd.SysProcAttr = &syscall.SysProcAttr{}
if uid > 0 && uid <= math.MaxUint32 && gid > 0 && gid <= math.MaxUint32 {
cmd.SysProcAttr.Credential = &syscall.Credential{Uid: uint32(uid), Gid: uint32(gid)}
} else {
return fmt.Errorf("uid and gid exceed uint32")
}

return cmd.Run()
}
Expand All @@ -97,12 +90,6 @@ func compilePodman(recipe api.Recipe, gid int, uid int) error {
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Dir = recipe.ParentPath
cmd.SysProcAttr = &syscall.SysProcAttr{}
if uid > 0 && uid <= math.MaxUint32 && gid > 0 && gid <= math.MaxUint32 {
cmd.SysProcAttr.Credential = &syscall.Credential{Uid: uint32(uid), Gid: uint32(gid)}
} else {
return fmt.Errorf("uid and gid exceed uint32")
}

return cmd.Run()
}
Loading