[mutt] 03/14: debian-specific/Md.etc_mailname_gethostbyname.patch slightly rewritten.
Antonio Radici
antonio at moszumanska.debian.org
Sat Jun 24 12:02:32 UTC 2017
This is an automated email from the git hooks/post-receive script.
antonio pushed a commit to branch master
in repository mutt.
commit 9ca9b502eaa120ac9a2509676f2301ac88a87053
Author: Antonio Radici <antonio at debian.org>
Date: Sat Jun 24 09:48:25 2017 +0100
debian-specific/Md.etc_mailname_gethostbyname.patch slightly rewritten.
---
debian/changelog | 1 +
.../Md.etc_mailname_gethostbyname.patch | 85 ++++++++++++++++------
2 files changed, 63 insertions(+), 23 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 9b5478a..2061b46 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,7 @@ mutt (1.8.3+20170609-1) UNRELEASED; urgency=medium
* New upstream NeoMutt release, 2017-06-09 (1.8.3) (Closes: 857687, 864024)
* debian/patches:
+ neomutt patch removed.
+ + debian-specific/Md.etc_mailname_gethostbyname.patch slightly rewritten.
-- Antonio Radici <antonio at debian.org> Sat, 24 Jun 2017 09:32:46 +0100
diff --git a/debian/patches/debian-specific/Md.etc_mailname_gethostbyname.patch b/debian/patches/debian-specific/Md.etc_mailname_gethostbyname.patch
index e7b2302..d3c62c2 100644
--- a/debian/patches/debian-specific/Md.etc_mailname_gethostbyname.patch
+++ b/debian/patches/debian-specific/Md.etc_mailname_gethostbyname.patch
@@ -10,19 +10,11 @@ used, rather than calling gethostbyname() on the actual hostname.
--- a/init.c
+++ b/init.c
-@@ -51,6 +51,7 @@
- #include <unistd.h>
- #include <string.h>
- #include <sys/utsname.h>
-+#include <netdb.h>
- #include <errno.h>
- #include <sys/wait.h>
- #include <sys/time.h>
-@@ -3654,6 +3655,31 @@
- return NULL;
- }
+@@ -85,6 +85,32 @@
-+int getmailname(char *s, size_t l)
+ static struct MyVar *MyVars;
+
++static int getmailname(char *s, size_t l)
+{
+ FILE *f;
+ char tmp[512];
@@ -47,19 +39,66 @@ used, rather than calling gethostbyname() on the actual hostname.
+ return (-1);
+}
+
- void mutt_init (int skip_sys_rc, LIST *commands)
++
+ static void myvar_set(const char *var, const char *val)
{
- struct passwd *pw;
-@@ -3749,8 +3775,10 @@
+ struct MyVar **cur = NULL;
+@@ -4017,28 +4043,40 @@
else
- Hostname = safe_strdup (utsname.nodename);
+ Hostname = safe_strdup(utsname.nodename);
-- /* now get FQDN. Use configured domain first, DNS next, then uname */
-- if (domain)
-+ /* now get FQDN. Use /etc/mailname first, then configured domain, DNS next, then uname */
-+ if (getmailname(buffer, sizeof (buffer)) != -1)
+-/* now get FQDN. Use configured domain first, DNS next, then uname */
++ /* If /etc/mailname is available, use that as domain name, otherwise the
++ * configured domain, DNS or numae (in order) */
++ if (getmailname(buffer, sizeof(buffer)) != -1)
++ {
+ Fqdn = safe_strdup(buffer);
-+ else if (domain)
++ }
+ #ifdef DOMAIN
+- /* we have a compile-time domain name, use that for Fqdn */
+- Fqdn = safe_malloc(mutt_strlen(DOMAIN) + mutt_strlen(Hostname) + 2);
+- sprintf(Fqdn, "%s.%s", NONULL(Hostname), DOMAIN);
++ if (!Fqdn)
++ {
++ Fqdn = safe_malloc(mutt_strlen(DOMAIN) + mutt_strlen(Hostname) + 2);
++ sprintf(Fqdn, "%s.%s", NONULL(Hostname), DOMAIN);
++ }
+ #else
+- if (!(getdnsdomainname(buffer, sizeof(buffer))))
++ if (!Fqdn)
{
- /* we have a compile-time domain name, use that for Fqdn */
- Fqdn = safe_malloc (mutt_strlen (domain) + mutt_strlen (Hostname) + 2);
+- Fqdn = safe_malloc(mutt_strlen(buffer) + mutt_strlen(Hostname) + 2);
+- sprintf(Fqdn, "%s.%s", NONULL(Hostname), buffer);
++ if (!getdnsdomainname(buffer, sizeof(buffer)))
++ {
++ Fqdn = safe_malloc(mutt_strlen(buffer) + mutt_strlen(Hostname) + 2);
++ sprintf(Fqdn, "%s.%s", NONULL(Hostname), buffer);
++ }
++ else
++ {
++ /*
++ * DNS failed, use the nodename. Whether or not the nodename had a '.' in
++ * it, we can use the nodename as the FQDN. On hosts where DNS is not
++ * being used, e.g. small network that relies on hosts files, a short host
++ * name is all that is required for SMTP to work correctly. It could be
++ * wrong, but we've done the best we can, at this point the onus is on the
++ * user to provide the correct hostname if the nodename won't work in their
++ * network.
++ */
++ Fqdn = safe_strdup(utsname.nodename);
++ }
+ }
+- else
+- /*
+- * DNS failed, use the nodename. Whether or not the nodename had a '.' in
+- * it, we can use the nodename as the FQDN. On hosts where DNS is not
+- * being used, e.g. small network that relies on hosts files, a short host
+- * name is all that is required for SMTP to work correctly. It could be
+- * wrong, but we've done the best we can, at this point the onus is on the
+- * user to provide the correct hostname if the nodename won't work in their
+- * network.
+- */
+- Fqdn = safe_strdup(utsname.nodename);
+ #endif
+
+ #ifdef USE_NNTP
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mutt/mutt.git
More information about the pkg-mutt-commits
mailing list