oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1//go:build unix
2
3package provider
4
5import (
6 "os"
7 "syscall"
8)
9
10// singleLink reports whether a file has one name only.
11func singleLink(info os.FileInfo) bool {
12 st, ok := info.Sys().(*syscall.Stat_t)
13 return ok && st.Nlink == 1
14}
15
16// ownedHere reports whether root or this user owns an entry.
17func ownedHere(info os.FileInfo) bool {
18 st, ok := info.Sys().(*syscall.Stat_t)
19 return ok && (st.Uid == 0 || int(st.Uid) == os.Geteuid())
20}
21
22// ownGroup reports whether an entry's group is this user's own.
23func ownGroup(info os.FileInfo) bool {
24 st, ok := info.Sys().(*syscall.Stat_t)
25 return ok && int(st.Gid) == os.Getegid()
26}
27