* Wed Apr 07 2021 Tomas Bzatek <tbzatek@redhat.com> - 9.60-1
- New upstream version 9.60 Also rebased and backported some patches from RHEL 8.
This commit is contained in:
parent
85ded7058f
commit
37746e9f84
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
/hdparm-9.58.tar.gz
|
/hdparm-9.58.tar.gz
|
||||||
|
/hdparm-9.60.tar.gz
|
||||||
|
23
hdparm-9.54-resourceleak-fixes-2.patch
Normal file
23
hdparm-9.54-resourceleak-fixes-2.patch
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
diff -up hdparm-9.54/hdparm.c.bak hdparm-9.54/hdparm.c
|
||||||
|
--- hdparm-9.54/hdparm.c.bak 2020-06-01 17:56:47.257520643 +0200
|
||||||
|
+++ hdparm-9.54/hdparm.c 2020-06-01 17:57:29.285084217 +0200
|
||||||
|
@@ -461,12 +461,15 @@ static void dump_identity (__u16 *idw)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
char pmodes[64] = {0,}, dmodes[128]={0,}, umodes[128]={0,};
|
||||||
|
- char *model = strip(strndup((char *)&idw[27], 40));
|
||||||
|
- char *fwrev = strip(strndup((char *)&idw[23], 8));
|
||||||
|
- char *serno = strip(strndup((char *)&idw[10], 20));
|
||||||
|
+ char *model = strndup((char *)&idw[27], 40);
|
||||||
|
+ char *model_s = strip(model);
|
||||||
|
+ char *fwrev = strndup((char *)&idw[23], 8);
|
||||||
|
+ char *fwrev_s = strip(fwrev);
|
||||||
|
+ char *serno = strndup((char *)&idw[10], 20);
|
||||||
|
+ char *serno_s = strip(serno);
|
||||||
|
__u8 tPIO;
|
||||||
|
|
||||||
|
- printf("\n Model=%.40s, FwRev=%.8s, SerialNo=%.20s", model, fwrev, serno);
|
||||||
|
+ printf("\n Model=%.40s, FwRev=%.8s, SerialNo=%.20s", model_s, fwrev_s, serno_s);
|
||||||
|
printf("\n Config={");
|
||||||
|
for (i = 0; i <= 15; i++) {
|
||||||
|
if (idw[0] & (1<<i))
|
81
hdparm-9.54-resourceleak-fixes.patch
Normal file
81
hdparm-9.54-resourceleak-fixes.patch
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
diff -urN hdparm-9.54/fibmap.c hdparm-9.54_patched/fibmap.c
|
||||||
|
--- hdparm-9.54/fibmap.c 2016-10-13 01:50:52.000000000 +0200
|
||||||
|
+++ hdparm-9.54_patched/fibmap.c 2018-10-04 12:17:39.630627349 +0200
|
||||||
|
@@ -232,6 +232,7 @@
|
||||||
|
if (fstat(fd, &st) == -1) {
|
||||||
|
err = errno;
|
||||||
|
perror(file_name);
|
||||||
|
+ close(fd);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
if (!S_ISREG(st.st_mode)) {
|
||||||
|
diff -urN hdparm-9.54/fwdownload.c hdparm-9.54_patched/fwdownload.c
|
||||||
|
--- hdparm-9.54/fwdownload.c 2017-12-06 13:41:40.000000000 +0100
|
||||||
|
+++ hdparm-9.54_patched/fwdownload.c 2018-10-04 12:19:23.819336125 +0200
|
||||||
|
@@ -95,12 +95,19 @@
|
||||||
|
int xfer_min = 1, xfer_max = 0xffff, xfer_size;
|
||||||
|
ssize_t offset;
|
||||||
|
|
||||||
|
- if ((fwfd = open(fwpath, O_RDONLY)) == -1 || fstat(fwfd, &st) == -1) {
|
||||||
|
+ if ((fwfd = open(fwpath, O_RDONLY)) == -1) {
|
||||||
|
err = errno;
|
||||||
|
perror(fwpath);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (fstat(fwfd, &st) == -1) {
|
||||||
|
+ err = errno;
|
||||||
|
+ perror(fwpath);
|
||||||
|
+ close(fwfd);
|
||||||
|
+ return err;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (!S_ISREG(st.st_mode)) {
|
||||||
|
fprintf(stderr, "%s: not a regular file\n", fwpath);
|
||||||
|
err = EINVAL;
|
||||||
|
diff -urN hdparm-9.54/hdparm.c hdparm-9.54_patched/hdparm.c
|
||||||
|
--- hdparm-9.54/hdparm.c 2018-02-03 19:10:40.000000000 +0100
|
||||||
|
+++ hdparm-9.54_patched/hdparm.c 2018-10-04 13:25:58.924126976 +0200
|
||||||
|
@@ -590,6 +590,9 @@
|
||||||
|
printf("\n");
|
||||||
|
printf("\n * signifies the current active mode\n");
|
||||||
|
printf("\n");
|
||||||
|
+ free(fwrev);
|
||||||
|
+ free(model);
|
||||||
|
+ free(serno);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const char *busstate_str (unsigned int value)
|
||||||
|
@@ -1174,8 +1177,10 @@
|
||||||
|
if (!shortened)
|
||||||
|
fdevname = strdup("the full disk");
|
||||||
|
|
||||||
|
- if (start_lba == 0ULL)
|
||||||
|
+ if (start_lba == 0ULL) {
|
||||||
|
+ free(fdevname);
|
||||||
|
return 0;
|
||||||
|
+ }
|
||||||
|
if (start_lba == START_LBA_UNKNOWN || fd_is_raid(fd)) {
|
||||||
|
fprintf(stderr, "%s is a RAID device: please specify an absolute LBA of a raw member device instead (raid1 only)\n", devname);
|
||||||
|
} else if (msg) {
|
||||||
|
@@ -1187,6 +1192,7 @@
|
||||||
|
fprintf(stderr, "The absolute LBA of sector %llu from %s should be %llu\n", lba, devname, start_lba + lba);
|
||||||
|
}
|
||||||
|
fprintf(stderr, "Aborting.\n");
|
||||||
|
+ free(fdevname);
|
||||||
|
exit(EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
diff -urN hdparm-9.54/sysfs.c hdparm-9.54_patched/sysfs.c
|
||||||
|
--- hdparm-9.54/sysfs.c 2018-10-04 12:14:29.900157666 +0200
|
||||||
|
+++ hdparm-9.54_patched/sysfs.c 2018-10-04 14:13:07.056659514 +0200
|
||||||
|
@@ -60,8 +63,8 @@
|
||||||
|
}
|
||||||
|
if (count < 0)
|
||||||
|
err = errno;
|
||||||
|
- fclose(fp);
|
||||||
|
}
|
||||||
|
+ fclose(fp);
|
||||||
|
if (err && verbose) perror(path);
|
||||||
|
*pathtail = '\0';
|
||||||
|
return err;
|
@ -1,7 +1,6 @@
|
|||||||
Index: hdparm-9.43/sgio.c
|
diff -up hdparm-9.60/sgio.c.bak hdparm-9.60/sgio.c
|
||||||
===================================================================
|
--- hdparm-9.60/sgio.c.bak 2019-01-03 23:37:54.000000000 +0100
|
||||||
--- hdparm-9.43.orig/sgio.c
|
+++ hdparm-9.60/sgio.c 2021-04-07 16:10:36.971836569 +0200
|
||||||
+++ hdparm-9.43/sgio.c
|
|
||||||
@@ -17,6 +17,10 @@
|
@@ -17,6 +17,10 @@
|
||||||
|
|
||||||
#include <linux/hdreg.h>
|
#include <linux/hdreg.h>
|
||||||
@ -22,7 +21,7 @@ Index: hdparm-9.43/sgio.c
|
|||||||
|
|
||||||
if (tf->command == ATA_OP_PIDENTIFY)
|
if (tf->command == ATA_OP_PIDENTIFY)
|
||||||
prefer12 = 0;
|
prefer12 = 0;
|
||||||
@@ -302,14 +306,16 @@ int sg16 (int fd, int rw, int dma, struc
|
@@ -306,14 +310,16 @@ int sg16 (int fd, int rw, int dma, struc
|
||||||
|
|
||||||
desc = sb + 8;
|
desc = sb + 8;
|
||||||
if (io_hdr.driver_status != SG_DRIVER_SENSE) {
|
if (io_hdr.driver_status != SG_DRIVER_SENSE) {
|
||||||
@ -44,4 +43,4 @@ Index: hdparm-9.43/sgio.c
|
|||||||
+#endif
|
+#endif
|
||||||
}
|
}
|
||||||
} else if (sb[0] != 0x72 || sb[7] < 14 || desc[0] != 0x09 || desc[1] < 0x0c) {
|
} else if (sb[0] != 0x72 || sb[7] < 14 || desc[0] != 0x09 || desc[1] < 0x0c) {
|
||||||
dump_bytes("SG_IO: bad/missing sense data, sb[]", sb, sizeof(sb));
|
if (verbose || tf->command != ATA_OP_IDENTIFY)
|
11
hdparm.spec
11
hdparm.spec
@ -1,13 +1,15 @@
|
|||||||
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.58
|
Version: 9.60
|
||||||
Release: 5%{?dist}
|
Release: 1%{?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
|
||||||
Patch0: %{name}-9.43-ditch_dead_code.patch
|
Patch0: %{name}-9.60-ditch_dead_code.patch
|
||||||
Patch1: %{name}-9.43-close_fd.patch
|
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
|
||||||
|
Patch4: %{name}-9.54-resourceleak-fixes-2.patch
|
||||||
|
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
@ -37,6 +39,9 @@ install -c -m 644 hdparm.8 $RPM_BUILD_ROOT/%{_mandir}/man8
|
|||||||
%{_mandir}/man8/hdparm.8*
|
%{_mandir}/man8/hdparm.8*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Apr 07 2021 Tomas Bzatek <tbzatek@redhat.com> - 9.60-1
|
||||||
|
- New upstream version 9.60
|
||||||
|
|
||||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 9.58-5
|
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 9.58-5
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||||
|
|
||||||
|
2
sources
2
sources
@ -1 +1 @@
|
|||||||
SHA512 (hdparm-9.58.tar.gz) = 42fb70f494aae4cc205ca68c3e883e1f4fc33e8ced1914e280e9f3faa7233d3f839e59178ec09ddb9d32e9d2bca122ce324645ecb5ac73defa284030ac7d3cea
|
SHA512 (hdparm-9.60.tar.gz) = e40b3b48b409014acd0ec0bd7ff821e850b127627b1f5114c442eeaf0b93f02c6933f93a221037255499b741071c0a5cb4d9cf7f9a06ff92a416caf82673a0ed
|
||||||
|
Loading…
Reference in New Issue
Block a user