parent
							
								
									a05056b3ca
								
							
						
					
					
						commit
						0445d85941
					
				
							
								
								
									
										14
									
								
								parse.go
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								parse.go
									
									
									
									
									
								
							@ -192,14 +192,14 @@ func parseHostedFTPLine(line string) (*Entry, error) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	scanner := newScanner(line)
 | 
						scanner := newScanner(line)
 | 
				
			||||||
	fields := scanner.NextFields(9)
 | 
						fields := scanner.NextFields(2)
 | 
				
			||||||
	if fields[1] == "0" { // Set link count to 1 and attempt to parse as Unix.
 | 
					 | 
				
			||||||
		fields[1] = "1"
 | 
					 | 
				
			||||||
		newLine := strings.Join(fields, " ")
 | 
					 | 
				
			||||||
		return parseLsListLine(newLine)
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	return nil, errUnsupportedListLine
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if len(fields) < 2 || fields[1] != "0" {
 | 
				
			||||||
 | 
							return nil, errUnsupportedListLine
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Set link count to 1 and attempt to parse as Unix.
 | 
				
			||||||
 | 
						return parseLsListLine(fields[0] + " 1 " + scanner.Remaining())
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// parseListLine parses the various non-standard format returned by the LIST
 | 
					// parseListLine parses the various non-standard format returned by the LIST
 | 
				
			||||||
 | 
				
			|||||||
@ -69,6 +69,7 @@ var listTestsFail = []unsupportedLine{
 | 
				
			|||||||
	{"modify=20150806235817;invalid;UNIX.owner=0; movies", "Unsupported LIST line"},
 | 
						{"modify=20150806235817;invalid;UNIX.owner=0; movies", "Unsupported LIST line"},
 | 
				
			||||||
	{"Zrwxrwxrwx   1 root     other          7 Jan 25 00:17 bin -> usr/bin", "Unknown entry type"},
 | 
						{"Zrwxrwxrwx   1 root     other          7 Jan 25 00:17 bin -> usr/bin", "Unknown entry type"},
 | 
				
			||||||
	{"total 1", "Unsupported LIST line"},
 | 
						{"total 1", "Unsupported LIST line"},
 | 
				
			||||||
 | 
						{"000000000x ", "Unsupported LIST line"}, // see https://github.com/jlaffaye/ftp/issues/97
 | 
				
			||||||
	{"", "Unsupported LIST line"},
 | 
						{"", "Unsupported LIST line"},
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user