File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1515package misc
1616
1717import (
18+ "slices"
1819 "strings"
1920
2021 "github.com/coreos/coreos-assembler/mantle/kola/cluster"
@@ -42,6 +43,12 @@ func CheckUserShells(c cluster.TestCluster) {
4243 "halt" : "/sbin/halt" ,
4344 "core" : "/bin/bash" ,
4445 }
46+ nologins := []string {
47+ "/usr/bin/nologin" ,
48+ "/usr/sbin/nologin" ,
49+ "/sbin/nologin" ,
50+ "/bin/nologin" ,
51+ }
4552
4653 output := c .MustSSH (m , "getent passwd" )
4754
@@ -61,7 +68,7 @@ func CheckUserShells(c cluster.TestCluster) {
6168 if shell != "/bin/bash" && shell != "/bin/sh" {
6269 badusers = append (badusers , user )
6370 }
64- } else if shell != ValidUsers [username ] && shell != "/sbin/nologin" && shell != "/usr/sbin/nologin" {
71+ } else if shell != ValidUsers [username ] && ! slices . Contains ( nologins , shell ) {
6572 badusers = append (badusers , user )
6673 }
6774 }
You can’t perform that action at this time.
0 commit comments