mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-19 20:46:40 +00:00
Upgrade containerd to 1.6.2 and CNI to 0.9.1
Upgrades containerd, and switches to the official 64-bit ARM binary. Continues to use my binary for 32-bit arm hosts. CNI upgraded to v0.9.1 Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
449bcf2691
commit
912ac265f4
49
vendor/github.com/containerd/continuity/fs/copy_windows.go
generated
vendored
49
vendor/github.com/containerd/continuity/fs/copy_windows.go
generated
vendored
@ -17,19 +17,60 @@
|
||||
package fs
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
winio "github.com/Microsoft/go-winio"
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
func copyFileInfo(fi os.FileInfo, name string) error {
|
||||
const (
|
||||
seTakeOwnershipPrivilege = "SeTakeOwnershipPrivilege"
|
||||
)
|
||||
|
||||
func copyFileInfo(fi os.FileInfo, src, name string) error {
|
||||
if err := os.Chmod(name, fi.Mode()); err != nil {
|
||||
return errors.Wrapf(err, "failed to chmod %s", name)
|
||||
return fmt.Errorf("failed to chmod %s: %w", name, err)
|
||||
}
|
||||
|
||||
// TODO: copy windows specific metadata
|
||||
// Copy file ownership and ACL
|
||||
// We need SeRestorePrivilege and SeTakeOwnershipPrivilege in order
|
||||
// to restore security info on a file, especially if we're trying to
|
||||
// apply security info which includes SIDs not necessarily present on
|
||||
// the host.
|
||||
privileges := []string{winio.SeRestorePrivilege, seTakeOwnershipPrivilege}
|
||||
if err := winio.EnableProcessPrivileges(privileges); err != nil {
|
||||
return err
|
||||
}
|
||||
defer winio.DisableProcessPrivileges(privileges)
|
||||
|
||||
secInfo, err := windows.GetNamedSecurityInfo(
|
||||
src, windows.SE_FILE_OBJECT,
|
||||
windows.OWNER_SECURITY_INFORMATION|windows.DACL_SECURITY_INFORMATION)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dacl, _, err := secInfo.DACL()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
sid, _, err := secInfo.Owner()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := windows.SetNamedSecurityInfo(
|
||||
name, windows.SE_FILE_OBJECT,
|
||||
windows.OWNER_SECURITY_INFORMATION|windows.DACL_SECURITY_INFORMATION,
|
||||
sid, nil, dacl, nil); err != nil {
|
||||
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user