summaryrefslogtreecommitdiff
path: root/pop3d
diff options
context:
space:
mode:
Diffstat (limited to 'pop3d')
-rw-r--r--pop3d/pop3d.c20
-rw-r--r--pop3d/pop3d.h6
2 files changed, 7 insertions, 19 deletions
diff --git a/pop3d/pop3d.c b/pop3d/pop3d.c
index d0e7b6057..75a5fe757 100644
--- a/pop3d/pop3d.c
+++ b/pop3d/pop3d.c
@@ -226,19 +226,13 @@ pop3d_mainloop (int fd, FILE *infile, FILE *outfile)
/* Prepare the shared secret for APOP. */
{
char *local_hostname;
- local_hostname = mu_alloc (MAXHOSTNAMELEN + 1);
-
- /* Get our canonical hostname. */
- {
- struct hostent *htbuf;
- gethostname (local_hostname, MAXHOSTNAMELEN);
- htbuf = gethostbyname (local_hostname);
- if (htbuf)
- {
- free (local_hostname);
- local_hostname = strdup (htbuf->h_name);
- }
- }
+
+ status = mu_get_host_name (&local_hostname);
+ if (status)
+ {
+ mu_diag_funcall (MU_DIAG_ERROR, "mu_get_host_name", NULL, status);
+ exit (EXIT_FAILURE);
+ }
md5shared = mu_alloc (strlen (local_hostname) + 51);
diff --git a/pop3d/pop3d.h b/pop3d/pop3d.h
index 1c1c7d622..ea773bcf6 100644
--- a/pop3d/pop3d.h
+++ b/pop3d/pop3d.h
@@ -137,12 +137,6 @@ extern int expire_on_exit;
#include <shadow.h>
#endif
-#ifndef MAXHOSTNAMELEN
-/* Maximum length of a hostname (is this defined somewhere else?). */
-/* MAXHOSTNAMELEN is already defined on Solaris. */
-# define MAXHOSTNAMELEN 64
-#endif
-
#define POP3_ATTRIBUTE_DELE 0x0001
#define POP3_ATTRIBUTE_RETR 0x0010

Return to:

Send suggestions and report system problems to the System administrator.