Skip to content
Permalink
Browse files

fix filename for badfile checks output

  • Loading branch information...
Collin Mulliner
Collin Mulliner committed Sep 19, 2019
1 parent 91121de commit ac25be869a96402255e683474116b56152219607
Showing with 4 additions and 4 deletions.
  1. +3 −3 pkg/analyzer/globalfilechecks/globalfilechecks.go
  2. +1 −1 test/test_cfg.base.toml
@@ -132,7 +132,7 @@ func (state *filePermsType) CheckFile(fi *fsparser.FileInfo, fpath string) error

for item := range state.config.BadFiles {
fullpath := fi.Name
// match the fullpath
// match the fullpath if it starts with "/"
if item[0] == '/' {
fullpath = path.Join(fpath, fi.Name)
}
@@ -147,9 +147,9 @@ func (state *filePermsType) CheckFile(fi *fsparser.FileInfo, fpath string) error
}

if state.config.BadFilesInformationalOnly {
state.a.AddInformational(path.Join(fpath, fullpath), msg)
state.a.AddInformational(path.Join(fpath, fi.Name), msg)
} else {
state.a.AddOffender(path.Join(fpath, fullpath), msg)
state.a.AddOffender(path.Join(fpath, fi.Name), msg)
}
}
}
@@ -8,7 +8,7 @@ SeLinuxLabel = false
WorldWrite = true
Uids = [0,1001,1002]
Gids = [0,1001,1002]
BadFiles = ["/file99", "*1"]
BadFiles = ["/file99", "*1", "/bin/elf_x8664"]

[FileTreeCheck]
OldTreeFilePath = "oldtree.json"

0 comments on commit ac25be8

Please sign in to comment.
You can’t perform that action at this time.