kdumpctl: fix fragile loops over find output
For loops over find output are fragile, use a while read loop: https://github.com/koalaman/shellcheck/wiki/SC2044 Signed-off-by: Kairui Song <kasong@redhat.com> Acked-by: Philipp Rudo <prudo@redhat.com
This commit is contained in:
		
							parent
							
								
									01613b7211
								
							
						
					
					
						commit
						dfb76467c9
					
				
							
								
								
									
										8
									
								
								kdumpctl
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								kdumpctl
									
									
									
									
									
								
							| @ -944,12 +944,12 @@ selinux_relabel() | |||||||
| 		return | 		return | ||||||
| 	fi | 	fi | ||||||
| 
 | 
 | ||||||
| 	for _i in $(find $_path); do | 	while IFS= read -r -d '' _i; do | ||||||
| 		_attr=$(getfattr -m "security.selinux" $_i 2>/dev/null) | 		_attr=$(getfattr -m "security.selinux" "$_i" 2>/dev/null) | ||||||
| 		if [ -z "$_attr" ]; then | 		if [ -z "$_attr" ]; then | ||||||
| 			restorecon $_i; | 			restorecon "$_i"; | ||||||
| 		fi | 		fi | ||||||
| 	done | 	done < <(find "$_path" -print0) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| check_fence_kdump_config() | check_fence_kdump_config() | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user