public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Miroslav Lichvar <mlichvar@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/slrn] epel10: - don't use gethostbyname
Date: Wed, 14 Oct 2026 13:16:22 GMT [thread overview]
Message-ID: <179198378205.1.16083996450183148838.rpms-slrn-fa4078217e60@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/slrn
Branch : epel10
Commit : fa4078217e602cce4ce9d09efe1416d79b5ebb6e
Author : Miroslav Lichvar <mlichvar@fedoraproject.org>
Date : 2007-10-16T10:29:26+00:00
Stats : +58/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/slrn/c/fa4078217e602cce4ce9d09efe1416d79b5ebb6e?branch=epel10
Log:
- don't use gethostbyname
---
diff --git a/slrn-0.9.8.1pl1-getaddr.patch b/slrn-0.9.8.1pl1-getaddr.patch
new file mode 100644
index 0000000..d8ddf0f
--- /dev/null
+++ b/slrn-0.9.8.1pl1-getaddr.patch
@@ -0,0 +1,52 @@
+diff -up slrn-0.9.8.1pl1/src/misc.c.getaddr slrn-0.9.8.1pl1/src/misc.c
+--- slrn-0.9.8.1pl1/src/misc.c.getaddr 2007-10-16 10:26:19.000000000 +0200
++++ slrn-0.9.8.1pl1/src/misc.c 2007-10-16 12:12:54.000000000 +0200
+@@ -2808,10 +2808,14 @@ int slrn_is_fqdn (char *h) /*{{{*/
+ /* Try to get a fully qualified domain name. */
+ static char *get_hostname (void)
+ {
++#ifdef HAVE_GETADDRINFO
++ struct addrinfo hint, *res;
++ int r;
++#else
+ struct hostent *host_entry;
++#endif
+ char buf[MAX_HOST_NAME_LEN + 1];
+
+- host_entry = NULL;
+ if ((-1 == gethostname (buf, MAX_HOST_NAME_LEN))
+ || (*buf == 0))
+ return NULL;
+@@ -2820,6 +2824,24 @@ static char *get_hostname (void)
+ * to get more information. Why isn't there a simplified interface to
+ * get the FQDN!!!!
+ */
++#ifdef HAVE_GETADDRINFO
++ memset(&hint, 0, sizeof (hint));
++ hint.ai_flags = AI_CANONNAME;
++
++ r = getaddrinfo(buf, NULL, &hint, &res);
++ if (r == EAI_AGAIN)
++ {
++ slrn_sleep (2);
++ r = getaddrinfo(buf, NULL, &hint, &res);
++ }
++
++ if (r == 0 && res && res->ai_canonname)
++ {
++ char *ret = slrn_safe_strmalloc (res->ai_canonname);
++ freeaddrinfo(res);
++ return ret;
++ }
++#else
+ host_entry = gethostbyname (buf);
+
+ #if defined(TRY_AGAIN) && !defined(MULTINET)
+@@ -2850,6 +2872,7 @@ static char *get_hostname (void)
+ return slrn_safe_strmalloc ((char *)host_entry->h_name);
+ }
+
++#endif
+ return slrn_safe_strmalloc (buf);
+ }
+
diff --git a/slrn.spec b/slrn.spec
index 3729aa8..a71499b 100644
--- a/slrn.spec
+++ b/slrn.spec
@@ -1,7 +1,7 @@
Summary: A threaded Internet news reader
Name: slrn
Version: 0.9.8.1pl1
-Release: 3.20070716cvs%{?dist}
+Release: 4.20070716cvs%{?dist}
License: GPLv2+
Group: Applications/Internet
Source0: slrn-%{version}.tar.bz2
@@ -13,6 +13,7 @@ Patch1: slrn-scorefile.patch
Patch2: slrn-0.9.8.1pl1-asearch.patch
Patch3: slrn-0.9.8.1pl1-20070716cvs.patch.bz2
Patch4: slrn-0.9.8.1pl1-nss.patch
+Patch5: slrn-0.9.8.1pl1-getaddr.patch
BuildRequires: automake autoconf gettext-devel
BuildRequires: nss-devel nss_compat_ossl-devel slang-devel /usr/sbin/sendmail
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -42,6 +43,7 @@ the slrnpull utility.
%patch2 -p1 -b .asearch
%patch3 -p1
%patch4 -p1 -b .nss
+%patch5 -p1 -b .getaddr
%build
sh ./autogen.sh -V
@@ -97,6 +99,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/slrnpull.1*
%changelog
+* Tue Oct 16 2007 Miroslav Lichvar <mlichvar@redhat.com> 0.9.8.1pl1-4.20070716cvs
+- don't use gethostbyname
+
* Fri Aug 24 2007 Miroslav Lichvar <mlichvar@redhat.com> 0.9.8.1pl1-3.20070716cvs
- update license tag
- update from CVS
reply other threads:[~2026-10-14 13:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179198378205.1.16083996450183148838.rpms-slrn-fa4078217e60@fedoraproject.org \
--to=mlichvar@fedoraproject.org \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox