MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / applyDecompressOwnership

Function applyDecompressOwnership

agent/app/service/file.go:656–669  ·  view source on GitHub ↗
(srcPath, dstPath string)

Source from the content-addressed store, hash-verified

654}
655
656func applyDecompressOwnership(srcPath, dstPath string) error {
657 info, err := os.Lstat(srcPath)
658 if err != nil {
659 return err
660 }
661 stat, ok := info.Sys().(*unix.Stat_t)
662 if !ok {
663 return nil
664 }
665 if info.Mode()&os.ModeSymlink != 0 {
666 return os.Lchown(dstPath, int(stat.Uid), int(stat.Gid))
667 }
668 return os.Chown(dstPath, int(stat.Uid), int(stat.Gid))
669}
670
671func (f *FileService) GetContent(op request.FileContentReq) (response.FileInfo, error) {
672 if files.ShouldDenySensitiveFileRead(op.Path) {

Callers 1

copyDecompressEntryFunction · 0.85

Calls 2

SysMethod · 0.80
ModeMethod · 0.80

Tested by

no test coverage detected