fix(scan): fix yum-ps warning Failed to exec which -bash (#1166)
				
					
				
			This commit is contained in:
		@@ -888,6 +888,7 @@ func (l *base) parseGrepProcMap(stdout string) (soPaths []string) {
 | 
			
		||||
	scanner := bufio.NewScanner(strings.NewReader(stdout))
 | 
			
		||||
	for scanner.Scan() {
 | 
			
		||||
		line := strings.TrimSpace(scanner.Text())
 | 
			
		||||
		line = strings.Split(line, ";")[0]
 | 
			
		||||
		soPaths = append(soPaths, line)
 | 
			
		||||
	}
 | 
			
		||||
	return soPaths
 | 
			
		||||
 
 | 
			
		||||
@@ -218,12 +218,14 @@ func Test_base_parseGrepProcMap(t *testing.T) {
 | 
			
		||||
			args: args{
 | 
			
		||||
				`/etc/selinux/targeted/contexts/files/file_contexts.bin
 | 
			
		||||
/etc/selinux/targeted/contexts/files/file_contexts.homedirs.bin
 | 
			
		||||
/usr/lib64/libdl-2.28.so`,
 | 
			
		||||
/usr/lib64/libdl-2.28.so
 | 
			
		||||
				/usr/lib64/libnss_files-2.17.so;601ccbf3`,
 | 
			
		||||
			},
 | 
			
		||||
			wantSoPaths: []string{
 | 
			
		||||
				"/etc/selinux/targeted/contexts/files/file_contexts.bin",
 | 
			
		||||
				"/etc/selinux/targeted/contexts/files/file_contexts.homedirs.bin",
 | 
			
		||||
				"/usr/lib64/libdl-2.28.so",
 | 
			
		||||
				`/usr/lib64/libnss_files-2.17.so`,
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user