fix(scan): allow exit 1 for no match lsof | grep (#863)

This commit is contained in:
Kota Kanbe
2019-07-06 23:15:34 +09:00
committed by GitHub
parent ccb0751ffd
commit 425464fd76

View File

@@ -789,7 +789,7 @@ func (l *base) parseGrepProcMap(stdout string) (soPaths []string) {
func (l *base) lsOfListen() (stdout string, err error) {
cmd := `lsof -i -P -n | grep LISTEN`
r := l.exec(util.PrependProxyEnv(cmd), sudo)
if !r.isSuccess() {
if !r.isSuccess(0, 1) {
return "", xerrors.Errorf("Failed to SSH: %s", r)
}
return r.Stdout, nil