mirror of
https://github.com/moby/buildkit.git
synced 2026-08-04 14:50:21 +00:00
23 lines
514 B
Go
23 lines
514 B
Go
package file
|
|
|
|
import (
|
|
"github.com/docker/docker/pkg/idtools"
|
|
copy "github.com/tonistiigi/fsutil/copy"
|
|
)
|
|
|
|
func mapUserToChowner(user *copy.User, _ *idtools.IdentityMapping) (copy.Chowner, error) {
|
|
if user == nil || user.SID == "" {
|
|
return func(old *copy.User) (*copy.User, error) {
|
|
if old == nil || old.SID == "" {
|
|
old = ©.User{
|
|
SID: idtools.ContainerAdministratorSidString,
|
|
}
|
|
}
|
|
return old, nil
|
|
}, nil
|
|
}
|
|
return func(*copy.User) (*copy.User, error) {
|
|
return user, nil
|
|
}, nil
|
|
}
|