update v-advance
This commit is contained in:
12
internal/utils/perm_linux.go
Normal file
12
internal/utils/perm_linux.go
Normal file
@@ -0,0 +1,12 @@
|
||||
//go:build linux
|
||||
|
||||
package utils
|
||||
|
||||
import "os"
|
||||
|
||||
// IsAdmin 检测当前用户是否为 root(UID=0)
|
||||
func IsAdmin() bool {
|
||||
return os.Geteuid() == 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user