Skip to content

Commit

Permalink
chore: 调整一下判断顺序
Browse files Browse the repository at this point in the history
  • Loading branch information
sjlleo committed Dec 12, 2022
1 parent 66ee62f commit 336151d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,19 @@ func flagApply() string {
}

func capabilities_check() {
uid := os.Getuid()
if uid == 0 {
// Running as root, skip checking capabilities
return
}

// Windows 判断放在前面,防止遇到一些奇奇怪怪的问题
if runtime.GOOS == "windows" {
// Running on Windows, skip checking capabilities
return
}

uid := os.Getuid()
if uid == 0 {
// Running as root, skip checking capabilities
return
}

/***
* 检查当前进程是否有两个关键的权限
==== 看不到我 ====
Expand Down

0 comments on commit 336151d

Please sign in to comment.