* Fri Apr 16 2021 Tomas Bzatek <tbzatek@redhat.com> - 9.60-3
- Fix fclose() on sysfs file write
This commit is contained in:
		
							parent
							
								
									cbd5d51ebf
								
							
						
					
					
						commit
						1ce45d3c54
					
				
							
								
								
									
										13
									
								
								hdparm-9.60-sysfs-fclose.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								hdparm-9.60-sysfs-fclose.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,13 @@ | |||||||
|  | diff -up hdparm-9.60/sysfs.c.bak hdparm-9.60/sysfs.c
 | ||||||
|  | --- hdparm-9.60/sysfs.c.bak	2021-04-15 15:48:56.806354847 +0200
 | ||||||
|  | +++ hdparm-9.60/sysfs.c	2021-04-16 14:44:42.520395436 +0200
 | ||||||
|  | @@ -61,7 +61,8 @@ static int sysfs_write_attr (char *path,
 | ||||||
|  |  		if (count < 0) | ||||||
|  |  			err = errno; | ||||||
|  |  	} | ||||||
|  | -	fclose(fp);
 | ||||||
|  | +	if (fp)
 | ||||||
|  | +		fclose(fp);
 | ||||||
|  |  	if (err && verbose) perror(path); | ||||||
|  |  	*pathtail = '\0'; | ||||||
|  |  	return err; | ||||||
| @ -1,7 +1,7 @@ | |||||||
| Summary: A utility for displaying and/or setting hard disk parameters | Summary: A utility for displaying and/or setting hard disk parameters | ||||||
| Name: hdparm | Name: hdparm | ||||||
| Version: 9.60 | Version: 9.60 | ||||||
| Release: 2%{?dist} | Release: 3%{?dist} | ||||||
| License: BSD | License: BSD | ||||||
| URL:    https://sourceforge.net/projects/%{name}/ | URL:    https://sourceforge.net/projects/%{name}/ | ||||||
| Source: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz | Source: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz | ||||||
| @ -10,6 +10,7 @@ Patch1: %{name}-9.43-close_fd.patch | |||||||
| Patch2: %{name}-9.43-get_geom.patch | Patch2: %{name}-9.43-get_geom.patch | ||||||
| Patch3: %{name}-9.54-resourceleak-fixes.patch | Patch3: %{name}-9.54-resourceleak-fixes.patch | ||||||
| Patch4: %{name}-9.54-resourceleak-fixes-2.patch | Patch4: %{name}-9.54-resourceleak-fixes-2.patch | ||||||
|  | Patch5: %{name}-9.60-sysfs-fclose.patch | ||||||
| 
 | 
 | ||||||
| BuildRequires: gcc | BuildRequires: gcc | ||||||
| BuildRequires: make | BuildRequires: make | ||||||
| @ -41,6 +42,9 @@ install -c -m 644 hdparm.8 $RPM_BUILD_ROOT%{_mandir}/man8 | |||||||
| %{_mandir}/man8/hdparm.8* | %{_mandir}/man8/hdparm.8* | ||||||
| 
 | 
 | ||||||
| %changelog | %changelog | ||||||
|  | * Fri Apr 16 2021 Tomas Bzatek <tbzatek@redhat.com> - 9.60-3 | ||||||
|  | - Fix fclose() on sysfs file write | ||||||
|  | 
 | ||||||
| * Thu Apr 15 2021 Tomas Bzatek <tbzatek@redhat.com> - 9.60-2 | * Thu Apr 15 2021 Tomas Bzatek <tbzatek@redhat.com> - 9.60-2 | ||||||
| - Move hdparm binary to /usr/sbin | - Move hdparm binary to /usr/sbin | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user