mirror of
https://github.com/containers/podman.git
synced 2025-10-17 19:24:04 +08:00
test/system: CopyDirectory() do not chown files
If the source dir is owned by another user then the test the chown will fail assuming we run the tests rootless. This function is only used by the quadlet tests and for the purpose all we need is to read the files so the simple fix is remove the chown as this should make the tests pass on the special debian gating env. Fixes #24802 Signed-off-by: Paul Holzinger <git@holzinger.dev>
This commit is contained in:
@ -20,7 +20,6 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@ -1469,11 +1468,6 @@ func CopyDirectory(srcDir, dest string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
stat, ok := fileInfo.Sys().(*syscall.Stat_t)
|
||||
if !ok {
|
||||
return fmt.Errorf("failed to get raw syscall.Stat_t data for %q", sourcePath)
|
||||
}
|
||||
|
||||
switch fileInfo.Mode() & os.ModeType {
|
||||
case os.ModeDir:
|
||||
if err := os.MkdirAll(destPath, 0755); err != nil {
|
||||
@ -1492,10 +1486,6 @@ func CopyDirectory(srcDir, dest string) error {
|
||||
}
|
||||
}
|
||||
|
||||
if err := os.Lchown(destPath, int(stat.Uid), int(stat.Gid)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fInfo, err := entry.Info()
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user