diff options
Diffstat (limited to 'mail-mta/postfix/files/postfix-2.0.9-get-FQDN.patch')
-rw-r--r-- | mail-mta/postfix/files/postfix-2.0.9-get-FQDN.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/mail-mta/postfix/files/postfix-2.0.9-get-FQDN.patch b/mail-mta/postfix/files/postfix-2.0.9-get-FQDN.patch new file mode 100644 index 0000000..06336d4 --- /dev/null +++ b/mail-mta/postfix/files/postfix-2.0.9-get-FQDN.patch @@ -0,0 +1,32 @@ +--- postfix-2.0.9/src/util/get_hostname.c.orig 2003-04-28 13:15:08.000000000 +0200 ++++ postfix-2.0.9/src/util/get_hostname.c 2003-04-28 13:36:47.000000000 +0200 +@@ -33,6 +33,7 @@ + #include <sys/param.h> + #include <string.h> + #include <unistd.h> ++#include <netdb.h> + + #if (MAXHOSTNAMELEN < 256) + #undef MAXHOSTNAMELEN +@@ -55,6 +56,7 @@ + const char *get_hostname(void) + { + char namebuf[MAXHOSTNAMELEN + 1]; ++ struct hostent *hp; + + /* + * The gethostname() call is not (or not yet) in ANSI or POSIX, but it is +@@ -66,9 +68,11 @@ + if (gethostname(namebuf, sizeof(namebuf)) < 0) + msg_fatal("gethostname: %m"); + namebuf[MAXHOSTNAMELEN] = 0; +- if (valid_hostname(namebuf, DO_GRIPE) == 0) ++ if (!(hp = gethostbyname(namebuf))) ++ msg_fatal("gethostbyname(\"%s\") does not resolve as a fully qualified domain name.", namebuf); ++ if (valid_hostname(hp->h_name, DO_GRIPE) == 0) + msg_fatal("unable to use my own hostname"); +- my_host_name = mystrdup(namebuf); ++ my_host_name = mystrdup(hp->h_name); + } + return (my_host_name); + } |