forked from authentricity/authentricity
16 lines
293 B
Go
16 lines
293 B
Go
|
package hostagent
|
||
|
|
||
|
import (
|
||
|
"github.com/varlink/go/varlink"
|
||
|
"go.e43.eu/authentricity/internal/peercred"
|
||
|
)
|
||
|
|
||
|
func AllowPrivileged(conn varlink.ReadWriterContext, uid uint32) bool {
|
||
|
creds := peercred.Get(conn)
|
||
|
if creds == nil {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
return creds.Uid == 0 || creds.Uid == uid
|
||
|
}
|