Skip to content

Commit

Permalink
fix(platform): fix selinux validation (#2220)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo Ryu authored Jan 4, 2023
1 parent f4c9de0 commit 8151aa4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/util/ssh/os.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ func FirewallEnabled(s Interface) (enabled bool, err error) {
}

func SelinuxEnabled(s Interface) (enabled bool, err error) {
stdout, _, exit, err := s.Exec("selinuxenabled")
if err != nil || exit != 0 {
// https://www.thegeekdiary.com/how-to-check-whether-selinux-is-enabled-or-disabled/
_, _, exist, err := s.Exec("selinuxenabled")
if err != nil {
return false, err
}
res := strings.TrimSpace(stdout)
return res == "0", nil
return exist == 0, nil
}

func CheckNFS(s Interface, server string, path string) (err error) {
Expand Down

0 comments on commit 8151aa4

Please sign in to comment.