Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
25eee74cd8
!12 fix memory leak
From: @binlingyu 
Reviewed-by: @robertxw 
Signed-off-by: @robertxw
2024-06-21 06:24:05 +00:00
binlingyu
570b449fd3 fix memory leak 2024-05-28 09:51:34 +08:00
openeuler-ci-bot
fd1245c590
!6 [sync] PR-5: update hostname version to 3.23
From: @openeuler-sync-bot 
Reviewed-by: @seuzw 
Signed-off-by: @seuzw
2022-10-31 06:32:12 +00:00
sherlock2010
123d9b9ec8 update hostname version to 3.23
(cherry picked from commit 8eaaf99dd78d58f5f8f703149b3aeaf466d18232)
2022-10-31 11:19:13 +08:00
openeuler-ci-bot
6c39f9224e !4 Add the compilation dependency of gcc.
From: @lijingyuan007
Reviewed-by: @zengwefeng
Signed-off-by: @zengwefeng
2021-05-27 21:32:13 +08:00
lijingyuan007
0c3d021370 Add the compilation dependency of gcc. 2021-05-27 10:51:12 +08:00
openeuler-ci-bot
55c7183485 !3 add yaml file
From: @quanhongfei
Reviewed-by: @wangxp006
Signed-off-by: @wangxp006
2020-11-23 09:54:56 +08:00
quanhongfei
076762e7e4 add yaml file 2020-11-19 20:39:49 +08:00
openeuler-ci-bot
05a656dbef !1 update hostname version to 3.21
Merge pull request !1 from eaglegai/master
2020-07-24 15:18:23 +08:00
eaglegai
bfd393f578 update hostname version to 3.21 2020-07-24 13:58:00 +08:00
6 changed files with 75 additions and 5 deletions

View File

@ -0,0 +1,38 @@
From ddacb22dac891332c759293ab6297090216b121b Mon Sep 17 00:00:00 2001
From: binlingyu <binlingyu@uniontech.com>
Date: Mon, 20 May 2024 16:24:12 +0800
Subject: [PATCH] fix-memory-leak
---
hostname.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/hostname.c b/hostname.c
index 5be268e..63200be 100644
--- a/hostname.c
+++ b/hostname.c
@@ -262,15 +262,20 @@ show_name(enum type_t type)
switch(type)
{
case DEFAULT:
- printf("%s\n", localhost());
+ p=localhost();
+ printf("%s\n", p);
+ free(p);
break;
case SHORT:
p = localhost();
*(strchrnul(p, '.')) = '\0';
printf("%s\n", p);
+ free(p);
break;
case NIS:
- printf("%s\n", localdomain());
+ p=localdomain();
+ printf("%s\n", p);
+ free(p);
break;
case NIS_DEF:
printf("%s\n", localnisdomain());
--
2.20.1

View File

@ -22,7 +22,7 @@ diff -up hostname/hostname.1.rh hostname/hostname.1
--- hostname/hostname.1.rh 2013-11-03 15:24:23.000000000 +0100
+++ hostname/hostname.1 2013-11-04 10:12:59.670379153 +0100
@@ -80,6 +80,28 @@ complete FQDN of the system is returned
.B "THE FQDN"
.B THE FQDN
below).
+.LP
@ -37,7 +37,7 @@ diff -up hostname/hostname.1.rh hostname/hostname.1
+and
+.BR gethostbyname(3)
+is that
+.BR gethostbyname(3)
+.BR gethostbyname(5)
+is network aware, so it consults
+.IR /etc/nsswitch.conf
+and
@ -51,7 +51,7 @@ diff -up hostname/hostname.1.rh hostname/hostname.1
When called with one argument or with the
.B \-\-file
@@ -105,8 +127,7 @@ command (see
.B "THE FQDN"
.B THE FQDN
below).
.LP
-The host name is usually set once at system startup in

View File

@ -1,7 +1,7 @@
Summary: Utility to set/show the host name or domain name
Name: hostname
Version: 3.20
Release: 7
Version: 3.23
Release: 2
License: GPLv2+
URL: http://packages.qa.debian.org/h/hostname.html
Source0: http://ftp.de.debian.org/debian/pool/main/h/hostname/hostname_%{version}.tar.gz
@ -9,6 +9,9 @@ Source1: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
Source2: nis-domainname
Source3: nis-domainname.service
Patch1: hostname-rh.patch
Patch2: 5000-fix-memory-leak.patch
BuildRequires: gcc
%description
This package provides funcions to display or set system's hostname or NIS domain
@ -48,5 +51,29 @@ fi
%{_libexecdir}/%{name}/*
%changelog
* Tue May 28 2024 binlingyu <binlingyu@uniontech.com> - 3.23-2
- Type:requirement
- ID:NA
- SUG:NA
- DESC:Fix memory leak.
* Sat Oct 29 2022 zhouyihang <zhouyihang3@h-partners.com> - 3.23-1
- Type:requirement
- ID:NA
- SUG:NA
- DESC:update hostname version to 3.23
* Thu May 27 2021 lijingyuan <lijingyuan3@huawei.com> - 3.21-2
- Type:requirement
- ID:NA
- SUG:NA
- DESC:Add the compilation dependency of gcc.
* Fri Jul 24 2020 gaihuiying <gaihuiying1@huawei.com> - 3.21-1
- Type:requirement
- ID:NA
- SUG:NA
- DESC:update hostname version to 3.21
* Fri Sep 20 2019 Alex Chao <zhaolei746@huawei.com> - 3.20-7
- Package init

5
hostname.yaml Normal file
View File

@ -0,0 +1,5 @@
version_control: NA
src_repo:
tag_prefix:
separator:
url: http://ftp.de.debian.org/debian/pool/main/h/hostname/

Binary file not shown.

BIN
hostname_3.23.tar.gz Normal file

Binary file not shown.