Compare commits

...

11 Commits

Author SHA1 Message Date
openeuler-ci-bot
2f386f1665
!34 升级到最新稳定版本9.65
From: @liusirui91 
Reviewed-by: @liuzhiqiang26 
Signed-off-by: @liuzhiqiang26
2022-11-01 08:12:54 +00:00
liusirui
33d73355a2 upgrade to latest release 9.65 2022-11-01 15:45:55 +08:00
openeuler-ci-bot
e67ab1a5a0
!30 修复license不一致问题
From: @liusirui91 
Reviewed-by: @liuzhiqiang26 
Signed-off-by: @liuzhiqiang26
2022-10-21 09:39:14 +00:00
liusirui
086e9e461e correct license 2022-10-20 16:47:50 +08:00
openeuler-ci-bot
5538a9adb4
!22 hdparm: fix fd leak in sysfs_write_attr()
From: @liuzhiqiang26 
Reviewed-by: @wubo009 
Signed-off-by: @wubo009
2022-03-01 08:12:29 +00:00
Zhiqiang Liu
4bf23f4238 hdparm: fix fd leak in sysfs_write_attr()
In sysfs_write_attr(), if "fmt[0] != %", will return without
close fp.

Fix issue: https://gitee.com/src-openeuler/hdparm/issues/I4S2C0

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
2022-03-01 15:52:12 +08:00
openeuler-ci-bot
5614c4a6fb
!14 修复hdparm打印密码的问题
Merge pull request !14 from linfeilong835/master
2022-01-22 03:16:21 +00:00
linfeilong835
b59568c34b
update hdparm.spec. 2022-01-22 02:45:19 +00:00
linfeilong835
3ed3581317
add 0002-hdparam-Remove-security_password-printing.patch. 2022-01-22 02:43:00 +00:00
openeuler-ci-bot
6714407eef !12 upgrade package to 9.62
From: @windfine
Reviewed-by: @liuzhiqiang26
Signed-off-by: @liuzhiqiang26
2021-11-23 11:08:27 +00:00
Li Jinlin
6f3bd50d69 upgrade package to 9.62 2021-11-23 10:28:12 +08:00
5 changed files with 103 additions and 3 deletions

View File

@ -0,0 +1,50 @@
From deaa52e44c5464a8360e540d7b35895bc51e5143 Mon Sep 17 00:00:00 2001
From: Wenchao Hao <haowenchao@huawei.com>
Date: Mon, 30 Nov 2020 17:29:55 +0800
Subject: [PATCH] hdparam: Remove security_password printing
In consideration of security, passwd should not printed
in log, so this commit remove security_password printing
in code.
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
Signed-off-by: volcanodragon <linfeilong@huawei.com>
---
hdparm.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/hdparm.c b/hdparm.c
index 8045c87..3282d93 100644
--- a/hdparm.c
+++ b/hdparm.c
@@ -989,8 +989,8 @@ do_set_security (int fd)
exit(EINVAL);
}
if (!quiet) {
- printf(" Issuing %s command, password=\"%s\", user=%s",
- description, security_password, (data[0] & 1) ? "master" : "user");
+ printf(" Issuing %s command, user=%s",
+ description, (data[0] & 1) ? "master" : "user");
if (security_command == ATA_OP_SECURITY_SET_PASS)
printf(", mode=%s", data[1] ? "max" : "high");
printf("\n");
@@ -3004,17 +3004,6 @@ static void get_security_password (int handle_NULL)
} else if (!handle_NULL || strcmp(argp, "NULL")) {
strcpy(security_password, argp);
}
- printf("security_password:");
- if (!binary_passwd) {
- printf(" \"%s\"\n", security_password);
- } else {
- unsigned int i;
- for (i = 0; i < maxlen; ++i) {
- unsigned char c = security_password[i];
- printf(" %02x", c);
- }
- putchar('\n');
- }
while (*argp)
++argp;
}
--
2.27.0

View File

@ -0,0 +1,33 @@
From ac3b725928b6b6c4a1188670a67ed5432744de26 Mon Sep 17 00:00:00 2001
From: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Date: Tue, 1 Mar 2022 15:47:02 +0800
Subject: [PATCH] hdparm: fix fd leak in sysfs_write_attr()
In sysfs_write_attr(), if "fmt[0] != %", will return without
close fp.
Fix issue: https://gitee.com/src-openeuler/hdparm/issues/I4S2C0
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
---
sysfs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sysfs.c b/sysfs.c
index 60b8146..722b2a9 100644
--- a/sysfs.c
+++ b/sysfs.c
@@ -60,8 +60,9 @@ static int sysfs_write_attr (char *path, const char *attr, const char *fmt, void
}
if (count < 0)
err = errno;
- fclose(fp);
}
+ if (!fp)
+ fclose(fp);
if (err && verbose) perror(path);
*pathtail = '\0';
return err;
--
1.8.3.1

Binary file not shown.

BIN
hdparm-9.65.tar.gz Normal file

Binary file not shown.

View File

@ -1,11 +1,13 @@
Name: hdparm Name: hdparm
Version: 9.58 Version: 9.65
Release: 2 Release: 1
Summary: A system utility for setting or showing hard drive parameters Summary: A system utility for setting or showing hard drive parameters
License: BSD License: BSD AND GPLv2
URL: https://sourceforge.net/projects/%{name}/ URL: https://sourceforge.net/projects/%{name}/
Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Patch1: 0001-hdparm-fallocate-close-fd.patch Patch1: 0001-hdparm-fallocate-close-fd.patch
Patch2: 0002-hdparam-Remove-security_password-printing.patch
Patch3: 0003-hdparm-fix-fd-leak-in-sysfs_write_attr.patch
BuildRequires: gcc BuildRequires: gcc
@ -42,6 +44,21 @@ install -c -m 644 hdparm.8 $RPM_BUILD_ROOT/%{_mandir}/man8
%{_mandir}/man8/hdparm.8* %{_mandir}/man8/hdparm.8*
%changelog %changelog
* Tue Nov 1 2022 liusirui <liusirui@huawei.com> 9.65-1
- upgrade to 9.65
* Thu Oct 20 2022 liusirui <liusirui@huawei.com> 9.62-4
- add GPLv2 to correct license
* Tue Mar 01 2022 Zhiqiang Liu <liuzhiqiang26@huawei.com> 9.62-3
- fix fd leak in sysfs_write_attr()
* Sat Jan 22 2022 volcanodragon <linfeilong@huawei.com> 9.62-2
- delete passwd print for security
* Tue Nov 23 2021 Li Jinlin <lijinlin3@huawei.com> 9.62-1
- upgrade package to 9.62
* Fri Jul 30 2021 chenyanpanHW <chenyanpan@huawei.com> - 9.58-2 * Fri Jul 30 2021 chenyanpanHW <chenyanpan@huawei.com> - 9.58-2
- DESC: delete -S git from %autosetup, and delete BuildRequires git - DESC: delete -S git from %autosetup, and delete BuildRequires git