forked from mirrors/linux-bench
Merge branch 'master' into patch-9
This commit is contained in:
commit
6b0b012425
2 changed files with 4 additions and 3 deletions
|
@ -262,7 +262,7 @@ groups:
|
|||
audit: "mount | grep /tmp"
|
||||
tests:
|
||||
test_items:
|
||||
- flag: "tmpfs on /tmp type tmpfs "
|
||||
- flag: "tmpfs on /tmp type tmpfs"
|
||||
set: true
|
||||
remediation: |
|
||||
For new installations, during installation create a custom partition setup and specify a separate partition for `/tmp` .
|
||||
|
|
5
utils.go
5
utils.go
|
@ -102,13 +102,14 @@ func GetLSM() (lsm string, err error) {
|
|||
}
|
||||
|
||||
func getPlatformVersion(output, platform string) string {
|
||||
flagRe := regexp.MustCompile("version_id" + `=([^ \n]*)`)
|
||||
flagRe := regexp.MustCompile(`version[_id]*=([^ \n]*)`)
|
||||
vals := flagRe.FindStringSubmatch(output)
|
||||
|
||||
if len(vals) > 1 {
|
||||
switch platform {
|
||||
case "rhel":
|
||||
return vals[1][:1] // Get the major version only, examaple: 7.6 will return 7
|
||||
case "ubuntu":
|
||||
return vals[1][:2] // Get the major version only, examaple: 18.04 will return 18
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue