Add -pipe flag #294

Solved the problem of trying to read from STDIN and stopping on the way when running from CRON or AWS Lambda.
This commit is contained in:
Kota Kanbe
2017-01-24 00:21:56 +09:00
parent 49b4b8be22
commit 2d854cd64d
9 changed files with 71 additions and 41 deletions

View File

@@ -97,11 +97,11 @@ func detectRedhat(c config.ServerInfo) (itsMe bool, red osTypeInterface) {
}
func (o *redhat) checkIfSudoNoPasswd() error {
cmd := "yum --version"
if o.Distro.Family == "centos" {
cmd = "echo N | " + cmd
}
r := o.exec(cmd, o.sudo())
cmd := "yum --version"
if o.Distro.Family == "centos" {
cmd = "echo N | " + cmd
}
r := o.exec(cmd, o.sudo())
if !r.isSuccess() {
o.log.Errorf("sudo error on %s", r)
return fmt.Errorf("Failed to sudo: %s", r)
@@ -644,7 +644,6 @@ func (o *redhat) scanUnsecurePackagesUsingYumPluginSecurity() (models.VulnInfos,
// All information collected.
// Convert to VulnInfos.
o.log.Info("Fetching CVE details...")
vinfos := models.VulnInfos{}
for _, advIDCveIDs := range advisoryCveIDsList {
for _, cveID := range advIDCveIDs.CveIDs {