Skip to content
quarry Artifact [26afd39bf7]
Login

Artifact [26afd39bf7]

Artifact 26afd39bf726804d7caff5f75dfed9b65c3c38f76c4fb00206eec1f2fa19de4b:


//go:build unix

package runner

import (
	"io/fs"
	"syscall"
)

// ownerOf is a file's owner and group, from the stat behind info.
func ownerOf(info fs.FileInfo) (uid, gid int, ok bool) {
	st, ok := info.Sys().(*syscall.Stat_t)
	if !ok {
		return 0, 0, false
	}
	return int(st.Uid), int(st.Gid), true
}