xref: /csrg-svn/usr.sbin/sendmail/src/daemon.c (revision 25657)
122700Sdist /*
222700Sdist **  Sendmail
322700Sdist **  Copyright (c) 1983  Eric P. Allman
422700Sdist **  Berkeley, California
522700Sdist **
622700Sdist **  Copyright (c) 1983 Regents of the University of California.
722700Sdist **  All rights reserved.  The Berkeley software License Agreement
822700Sdist **  specifies the terms and conditions for redistribution.
922700Sdist */
1022700Sdist 
1122700Sdist 
126039Seric # include <errno.h>
134535Seric # include "sendmail.h"
144535Seric 
1523120Seric # ifndef DAEMON
1623120Seric # ifndef lint
17*25657Seric static char	SccsId[] = "@(#)daemon.c	5.16 (Berkeley) 12/26/85	(w/o daemon mode)";
1823120Seric # endif not lint
1923120Seric # else
204535Seric 
2123120Seric # include <netdb.h>
2224945Seric # include <sys/signal.h>
2323120Seric # include <sys/wait.h>
2423120Seric # include <sys/time.h>
2523120Seric # include <sys/resource.h>
265978Seric 
2723120Seric # ifndef lint
28*25657Seric static char	SccsId[] = "@(#)daemon.c	5.16 (Berkeley) 12/26/85 (with daemon mode)";
2923120Seric # endif not lint
305978Seric 
314535Seric /*
324535Seric **  DAEMON.C -- routines to use when running as a daemon.
337556Seric **
347556Seric **	This entire file is highly dependent on the 4.2 BSD
357556Seric **	interprocess communication primitives.  No attempt has
367556Seric **	been made to make this file portable to Version 7,
377556Seric **	Version 6, MPX files, etc.  If you should try such a
387556Seric **	thing yourself, I recommend chucking the entire file
397556Seric **	and starting from scratch.  Basic semantics are:
407556Seric **
417556Seric **	getrequests()
427556Seric **		Opens a port and initiates a connection.
437556Seric **		Returns in a child.  Must set InChannel and
447556Seric **		OutChannel appropriately.
4510206Seric **	clrdaemon()
4610206Seric **		Close any open files associated with getting
4710206Seric **		the connection; this is used when running the queue,
4810206Seric **		etc., to avoid having extra file descriptors during
4910206Seric **		the queue run and to avoid confusing the network
5010206Seric **		code (if it cares).
517556Seric **	makeconnection(host, port, outfile, infile)
527556Seric **		Make a connection to the named host on the given
537556Seric **		port.  Set *outfile and *infile to the files
547556Seric **		appropriate for communication.  Returns zero on
557556Seric **		success, else an exit status describing the
567556Seric **		error.
577556Seric **
587556Seric **	The semantics of both of these should be clean.
594535Seric */
604535Seric /*
614535Seric **  GETREQUESTS -- open mail IPC port and get requests.
624535Seric **
634535Seric **	Parameters:
644535Seric **		none.
654535Seric **
664535Seric **	Returns:
674535Seric **		none.
684535Seric **
694535Seric **	Side Effects:
704535Seric **		Waits until some interesting activity occurs.  When
714535Seric **		it does, a child is created to process it, and the
724535Seric **		parent waits for completion.  Return from this
739886Seric **		routine is always in the child.  The file pointers
749886Seric **		"InChannel" and "OutChannel" should be set to point
759886Seric **		to the communication channel.
764535Seric */
774535Seric 
7810206Seric struct sockaddr_in	SendmailAddress;/* internet address of sendmail */
799610Seric 
8016144Seric int	DaemonSocket	= -1;		/* fd describing socket */
8116890Seric char	*NetName;			/* name of home (local?) network */
8216144Seric 
834535Seric getrequests()
844535Seric {
859610Seric 	int t;
869610Seric 	register struct servent *sp;
8725027Seric 	int on = 1;
8824945Seric 	extern reapchild();
897117Seric 
909610Seric 	/*
919610Seric 	**  Set up the address for the mailer.
929610Seric 	*/
939610Seric 
949610Seric 	sp = getservbyname("smtp", "tcp");
959610Seric 	if (sp == NULL)
969610Seric 	{
979610Seric 		syserr("server \"smtp\" unknown");
9810167Seric 		goto severe;
999610Seric 	}
1009610Seric 	SendmailAddress.sin_family = AF_INET;
1019610Seric 	SendmailAddress.sin_addr.s_addr = INADDR_ANY;
1029740Ssam 	SendmailAddress.sin_port = sp->s_port;
1039610Seric 
1049610Seric 	/*
1059610Seric 	**  Try to actually open the connection.
1069610Seric 	*/
1079610Seric 
1089610Seric # ifdef DEBUG
1099610Seric 	if (tTd(15, 1))
1109610Seric 		printf("getrequests: port 0x%x\n", SendmailAddress.sin_port);
1119610Seric # endif DEBUG
1129610Seric 
1139610Seric 	/* get a socket for the SMTP connection */
11423120Seric 	DaemonSocket = socket(AF_INET, SOCK_STREAM, 0);
11510206Seric 	if (DaemonSocket < 0)
1169610Seric 	{
1179610Seric 		/* probably another daemon already */
1189610Seric 		syserr("getrequests: can't create socket");
1199610Seric 	  severe:
1209610Seric # ifdef LOG
1219610Seric 		if (LogLevel > 0)
12224858Seric 			syslog(LOG_ALERT, "cannot get connection");
1239610Seric # endif LOG
1249610Seric 		finis();
1259610Seric 	}
12610347Seric 
12710347Seric #ifdef DEBUG
12810347Seric 	/* turn on network debugging? */
12910347Seric 	if (tTd(15, 15))
13024945Seric 		(void) setsockopt(DaemonSocket, SOL_SOCKET, SO_DEBUG, (char *)&on, sizeof on);
13110347Seric #endif DEBUG
13210347Seric 
13325027Seric 	(void) setsockopt(DaemonSocket, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof on);
13425027Seric 	(void) setsockopt(DaemonSocket, SOL_SOCKET, SO_KEEPALIVE, (char *)&on, sizeof on);
13525027Seric 
13623120Seric 	if (bind(DaemonSocket, &SendmailAddress, sizeof SendmailAddress) < 0)
1379610Seric 	{
1389610Seric 		syserr("getrequests: cannot bind");
13910206Seric 		(void) close(DaemonSocket);
1409610Seric 		goto severe;
1419610Seric 	}
14223120Seric 	if (listen(DaemonSocket, 10) < 0)
14323120Seric 	{
14423120Seric 		syserr("getrequests: cannot listen");
14523120Seric 		(void) close(DaemonSocket);
14623120Seric 		goto severe;
14723120Seric 	}
1489610Seric 
14924955Seric 	(void) signal(SIGCHLD, reapchild);
15024945Seric 
1519610Seric # ifdef DEBUG
1529610Seric 	if (tTd(15, 1))
15310206Seric 		printf("getrequests: %d\n", DaemonSocket);
1549610Seric # endif DEBUG
1559610Seric 
1564631Seric 	for (;;)
1574631Seric 	{
15814875Seric 		register int pid;
15911147Seric 		auto int lotherend;
16011147Seric 		struct sockaddr_in otherend;
16114875Seric 		extern int RefuseLA;
16211147Seric 
16314875Seric 		/* see if we are rejecting connections */
16414875Seric 		while (getla() > RefuseLA)
16514875Seric 			sleep(5);
16614875Seric 
1679610Seric 		/* wait for a connection */
1689610Seric 		do
1699610Seric 		{
1709610Seric 			errno = 0;
1719610Seric 			lotherend = sizeof otherend;
17223120Seric 			t = accept(DaemonSocket, &otherend, &lotherend);
1739610Seric 		} while (t < 0 && errno == EINTR);
1749610Seric 		if (t < 0)
1755978Seric 		{
1769610Seric 			syserr("getrequests: accept");
1779610Seric 			sleep(5);
1789610Seric 			continue;
1795978Seric 		}
1804631Seric 
1815978Seric 		/*
1825978Seric 		**  Create a subprocess to process the mail.
1835978Seric 		*/
1845978Seric 
1855978Seric # ifdef DEBUG
1867677Seric 		if (tTd(15, 2))
1879610Seric 			printf("getrequests: forking (fd = %d)\n", t);
1885978Seric # endif DEBUG
1895978Seric 
1904636Seric 		pid = fork();
1914636Seric 		if (pid < 0)
1924631Seric 		{
1934636Seric 			syserr("daemon: cannot fork");
1944636Seric 			sleep(10);
1959610Seric 			(void) close(t);
1964636Seric 			continue;
1974631Seric 		}
1984631Seric 
1994636Seric 		if (pid == 0)
2004631Seric 		{
20111147Seric 			extern struct hostent *gethostbyaddr();
20211147Seric 			register struct hostent *hp;
20311147Seric 			char buf[MAXNAME];
20411147Seric 
2054636Seric 			/*
2064636Seric 			**  CHILD -- return to caller.
20711147Seric 			**	Collect verified idea of sending host.
2084636Seric 			**	Verify calling user id if possible here.
2094636Seric 			*/
2104631Seric 
21124955Seric 			(void) signal(SIGCHLD, SIG_DFL);
21224950Seric 
21311147Seric 			/* determine host name */
21425616Seric 			hp = gethostbyaddr((char *) &otherend.sin_addr, sizeof otherend.sin_addr, AF_INET);
21511147Seric 			if (hp != NULL)
21616890Seric 			{
21723104Seric 				(void) strcpy(buf, hp->h_name);
21816890Seric 				if (NetName != NULL && NetName[0] != '\0' &&
21916894Seric 				    index(hp->h_name, '.') == NULL)
22016890Seric 				{
22123104Seric 					(void) strcat(buf, ".");
22223104Seric 					(void) strcat(buf, NetName);
22316890Seric 				}
22416890Seric 			}
22511147Seric 			else
22616884Seric 			{
22716884Seric 				extern char *inet_ntoa();
22816884Seric 
22916884Seric 				/* produce a dotted quad */
23016884Seric 				(void) sprintf(buf, "[%s]",
23116884Seric 					inet_ntoa(otherend.sin_addr));
23216884Seric 			}
23316884Seric 
23416884Seric 			/* should we check for illegal connection here? XXX */
23516884Seric 
23611147Seric 			RealHostName = newstr(buf);
23711147Seric 
23810206Seric 			(void) close(DaemonSocket);
2399610Seric 			InChannel = fdopen(t, "r");
24021062Seric 			OutChannel = fdopen(dup(t), "w");
2415978Seric # ifdef DEBUG
2427677Seric 			if (tTd(15, 2))
2435978Seric 				printf("getreq: returning\n");
2445978Seric # endif DEBUG
2457876Seric # ifdef LOG
2467876Seric 			if (LogLevel > 11)
2477876Seric 				syslog(LOG_DEBUG, "connected, pid=%d", getpid());
2487876Seric # endif LOG
2494636Seric 			return;
2504631Seric 		}
2514631Seric 
2527117Seric 		/* close the port so that others will hang (for a while) */
2539610Seric 		(void) close(t);
2544631Seric 	}
2559886Seric 	/*NOTREACHED*/
2564631Seric }
2575978Seric /*
25824945Seric **  REAPCHILD -- pick up the body of my child, lest it become a zombie
25924945Seric **
26024945Seric **	Parameters:
26124945Seric **		none.
26224945Seric **
26324945Seric **	Returns:
26424945Seric **		none.
26524945Seric **
26624945Seric **	Side Effects:
26724945Seric **		Picks up zombies.
26824945Seric */
26924945Seric 
27024945Seric reapchild()
27124945Seric {
27224945Seric 	union wait status;
27324945Seric 
27424945Seric 	while (wait3(&status, WNOHANG, (struct rusage *) NULL) > 0)
27524945Seric 		continue;
27624945Seric }
27724945Seric /*
27810206Seric **  CLRDAEMON -- reset the daemon connection
27910206Seric **
28010206Seric **	Parameters:
28110206Seric **		none.
28210206Seric **
28310206Seric **	Returns:
28410206Seric **		none.
28510206Seric **
28610206Seric **	Side Effects:
28710206Seric **		releases any resources used by the passive daemon.
28810206Seric */
28910206Seric 
29010206Seric clrdaemon()
29110206Seric {
29210206Seric 	if (DaemonSocket >= 0)
29310206Seric 		(void) close(DaemonSocket);
29410206Seric 	DaemonSocket = -1;
29510206Seric }
29610206Seric /*
2976039Seric **  MAKECONNECTION -- make a connection to an SMTP socket on another machine.
2986039Seric **
2996039Seric **	Parameters:
3006039Seric **		host -- the name of the host.
3016633Seric **		port -- the port number to connect to.
3026039Seric **		outfile -- a pointer to a place to put the outfile
3036039Seric **			descriptor.
3046039Seric **		infile -- ditto for infile.
3056039Seric **
3066039Seric **	Returns:
3076039Seric **		An exit code telling whether the connection could be
3086039Seric **			made and if not why not.
3096039Seric **
3106039Seric **	Side Effects:
3116039Seric **		none.
3126039Seric */
3135978Seric 
31425475Smiriam int	h_errno;	/*this will go away when code implemented*/
31525475Smiriam 
3166633Seric makeconnection(host, port, outfile, infile)
3176039Seric 	char *host;
3187286Seric 	u_short port;
3196039Seric 	FILE **outfile;
3206039Seric 	FILE **infile;
3216039Seric {
3226039Seric 	register int s;
3236039Seric 
3246039Seric 	/*
3256039Seric 	**  Set up the address for the mailer.
3269308Seric 	**	Accept "[a.b.c.d]" syntax for host name.
3276039Seric 	*/
3286039Seric 
32925475Smiriam 	h_errno = 0;
33025475Smiriam 	errno = 0;
33125475Smiriam 
3329308Seric 	if (host[0] == '[')
3339308Seric 	{
33411147Seric 		long hid;
33511147Seric 		register char *p = index(host, ']');
3369308Seric 
33711147Seric 		if (p != NULL)
3389308Seric 		{
33911147Seric 			*p = '\0';
34011147Seric 			hid = inet_addr(&host[1]);
34111147Seric 			*p = ']';
3429308Seric 		}
34311147Seric 		if (p == NULL || hid == -1)
3449308Seric 		{
3459308Seric 			usrerr("Invalid numeric domain spec \"%s\"", host);
3469308Seric 			return (EX_NOHOST);
3479308Seric 		}
3489308Seric 		SendmailAddress.sin_addr.s_addr = hid;
3499308Seric 	}
3509610Seric 	else
3519610Seric 	{
3529610Seric 		register struct hostent *hp = gethostbyname(host);
3539610Seric 
35425475Smiriam 		if (hp == NULL)
35524945Seric 		{
35625475Smiriam 			if (errno == ETIMEDOUT || h_errno == TRY_AGAIN)
35725475Smiriam 			{
35825475Smiriam 				CurEnv->e_flags &= ~EF_FATALERRS;
35925475Smiriam 				return (EX_TEMPFAIL);
36025475Smiriam 			}
361*25657Seric 
362*25657Seric 			/*
363*25657Seric 			**  XXX Should look for mail forwarder record here
364*25657Seric 			**  XXX if (h_errno == NO_ADDRESS).
365*25657Seric 			*/
366*25657Seric 
36725475Smiriam 			return (EX_NOHOST);
36824945Seric 		}
36916884Seric 		bcopy(hp->h_addr, (char *) &SendmailAddress.sin_addr, hp->h_length);
3709610Seric 	}
3719610Seric 
3729610Seric 	/*
3739610Seric 	**  Determine the port number.
3749610Seric 	*/
3759610Seric 
37610011Seric 	if (port != 0)
37710011Seric 		SendmailAddress.sin_port = htons(port);
37810011Seric 	else
3799610Seric 	{
3809610Seric 		register struct servent *sp = getservbyname("smtp", "tcp");
3819610Seric 
3829610Seric 		if (sp == NULL)
3839610Seric 		{
3849610Seric 			syserr("makeconnection: server \"smtp\" unknown");
3859610Seric 			return (EX_OSFILE);
3869610Seric 		}
38710011Seric 		SendmailAddress.sin_port = sp->s_port;
3889610Seric 	}
3896039Seric 
3906039Seric 	/*
3916039Seric 	**  Try to actually open the connection.
3926039Seric 	*/
3936039Seric 
3946039Seric # ifdef DEBUG
3957677Seric 	if (tTd(16, 1))
3966039Seric 		printf("makeconnection (%s)\n", host);
3976039Seric # endif DEBUG
3986039Seric 
39923120Seric 	s = socket(AF_INET, SOCK_STREAM, 0);
4006039Seric 	if (s < 0)
4016039Seric 	{
4026039Seric 		syserr("makeconnection: no socket");
4036039Seric 		goto failure;
4046039Seric 	}
4056039Seric 
4066039Seric # ifdef DEBUG
4077677Seric 	if (tTd(16, 1))
4086039Seric 		printf("makeconnection: %d\n", s);
40910347Seric 
41010347Seric 	/* turn on network debugging? */
41110347Seric 	if (tTd(16, 14))
41224945Seric 	{
41324945Seric 		int on = 1;
41424945Seric 		(void) setsockopt(DaemonSocket, SOL_SOCKET, SO_DEBUG, (char *)&on, sizeof on);
41524945Seric 	}
4166039Seric # endif DEBUG
4179546Seric 	(void) fflush(CurEnv->e_xfp);			/* for debugging */
41814383Seric 	errno = 0;					/* for debugging */
4199610Seric 	SendmailAddress.sin_family = AF_INET;
42023120Seric 	if (connect(s, &SendmailAddress, sizeof SendmailAddress) < 0)
4216039Seric 	{
4226039Seric 		/* failure, decide if temporary or not */
4236039Seric 	failure:
4246039Seric 		switch (errno)
4256039Seric 		{
4266039Seric 		  case EISCONN:
4276039Seric 		  case ETIMEDOUT:
4286897Seric 		  case EINPROGRESS:
4296897Seric 		  case EALREADY:
4306897Seric 		  case EADDRINUSE:
43110123Seric 		  case EHOSTDOWN:
4326897Seric 		  case ENETDOWN:
4336897Seric 		  case ENETRESET:
4346897Seric 		  case ENOBUFS:
4357204Seric 		  case ECONNREFUSED:
43611546Seric 		  case ECONNRESET:
43710081Seric 		  case EHOSTUNREACH:
43810098Seric 		  case ENETUNREACH:
4396039Seric 			/* there are others, I'm sure..... */
44016884Seric 			CurEnv->e_flags &= ~EF_FATALERRS;
4416039Seric 			return (EX_TEMPFAIL);
4426039Seric 
44311147Seric 		  case EPERM:
44411147Seric 			/* why is this happening? */
44511147Seric 			syserr("makeconnection: funny failure, addr=%lx, port=%x",
44611147Seric 				SendmailAddress.sin_addr.s_addr, SendmailAddress.sin_port);
44714383Seric 			return (EX_TEMPFAIL);
44811147Seric 
4496039Seric 		  default:
4506039Seric 			return (EX_UNAVAILABLE);
4516039Seric 		}
4526039Seric 	}
4536039Seric 
4546039Seric 	/* connection ok, put it into canonical form */
4556039Seric 	*outfile = fdopen(s, "w");
4566039Seric 	*infile = fdopen(s, "r");
4576039Seric 
45810098Seric 	return (EX_OK);
4596039Seric }
46010758Seric /*
46110758Seric **  MYHOSTNAME -- return the name of this host.
46210758Seric **
46310758Seric **	Parameters:
46410758Seric **		hostbuf -- a place to return the name of this host.
46512313Seric **		size -- the size of hostbuf.
46610758Seric **
46710758Seric **	Returns:
46810758Seric **		A list of aliases for this host.
46910758Seric **
47010758Seric **	Side Effects:
47110758Seric **		none.
47210758Seric */
4736039Seric 
47410758Seric char **
47512313Seric myhostname(hostbuf, size)
47610758Seric 	char hostbuf[];
47712313Seric 	int size;
47810758Seric {
47910758Seric 	extern struct hostent *gethostbyname();
48011147Seric 	struct hostent *hp;
48110758Seric 
48223120Seric 	if (gethostname(hostbuf, size) < 0)
48323120Seric 	{
48423120Seric 		(void) strcpy(hostbuf, "localhost");
48523120Seric 	}
48611147Seric 	hp = gethostbyname(hostbuf);
48711147Seric 	if (hp != NULL)
48816877Seric 	{
48923104Seric 		(void) strcpy(hostbuf, hp->h_name);
49011147Seric 		return (hp->h_aliases);
49116877Seric 	}
49210758Seric 	else
49310758Seric 		return (NULL);
49410758Seric }
49516911Seric /*
49616911Seric **  MAPHOSTNAME -- turn a hostname into canonical form
49716911Seric **
49816911Seric **	Parameters:
49916911Seric **		hbuf -- a buffer containing a hostname.
50016911Seric **		hbsize -- the size of hbuf.
50116911Seric **
50216911Seric **	Returns:
50316911Seric **		none.
50416911Seric **
50516911Seric **	Side Effects:
50616911Seric **		Looks up the host specified in hbuf.  If it is not
50716911Seric **		the canonical name for that host, replace it with
50816911Seric **		the canonical name.  If the name is unknown, or it
50916911Seric **		is already the canonical name, leave it unchanged.
51016911Seric */
51110758Seric 
51216911Seric maphostname(hbuf, hbsize)
51316911Seric 	char *hbuf;
51416911Seric 	int hbsize;
51516911Seric {
51616911Seric 	register struct hostent *hp;
51716911Seric 	extern struct hostent *gethostbyname();
51816911Seric 
51925574Smiriam 	/*
52025616Seric 	**  If first character is a bracket, then it is an address
52125616Seric 	**  lookup.  Address is copied into a temporary buffer to
52225616Seric 	**  strip the brackets and to preserve hbuf if address is
52325616Seric 	**  unknown.
52425616Seric 	*/
52525574Smiriam 
52625574Smiriam 	if (*hbuf == '[')
52725574Smiriam 	{
52825574Smiriam 		extern struct hostent *gethostbyaddr();
52925574Smiriam 		u_long in_addr;
53025574Smiriam 		char ptr[256];
53125574Smiriam 		char *bptr;
53225574Smiriam 
53325616Seric 		(void) strcpy(ptr, hbuf);
53425574Smiriam 		bptr = index(ptr,']');
53525574Smiriam 		*bptr = '\0';
53625574Smiriam 		in_addr = inet_addr(&ptr[1]);
53725616Seric 		hp = gethostbyaddr((char *) &in_addr, sizeof(struct in_addr), AF_INET);
53825616Seric 		if (hp == NULL)
53925616Seric 			return;
54025574Smiriam 	}
54125574Smiriam 	else
54225574Smiriam 	{
54325574Smiriam 		makelower(hbuf);
54425574Smiriam 		hp = gethostbyname(hbuf);
54525574Smiriam 	}
54616911Seric 	if (hp != NULL)
54716911Seric 	{
54816911Seric 		int i = strlen(hp->h_name);
54916911Seric 
55016911Seric 		if (i >= hbsize)
55116911Seric 			hp->h_name[--i] = '\0';
55223104Seric 		(void) strcpy(hbuf, hp->h_name);
55316911Seric 	}
55416911Seric }
55516911Seric 
55610758Seric # else DAEMON
55716911Seric /* code for systems without sophisticated networking */
55810758Seric 
55910758Seric /*
56010758Seric **  MYHOSTNAME -- stub version for case of no daemon code.
56111297Seric **
56211297Seric **	Can't convert to upper case here because might be a UUCP name.
56312313Seric **
56412313Seric **	Mark, you can change this to be anything you want......
56510758Seric */
56610758Seric 
56710758Seric char **
56812313Seric myhostname(hostbuf, size)
56910758Seric 	char hostbuf[];
57012313Seric 	int size;
57110758Seric {
57210758Seric 	register FILE *f;
57310758Seric 
57410758Seric 	hostbuf[0] = '\0';
57510758Seric 	f = fopen("/usr/include/whoami", "r");
57610758Seric 	if (f != NULL)
57710758Seric 	{
57812313Seric 		(void) fgets(hostbuf, size, f);
57910758Seric 		fixcrlf(hostbuf, TRUE);
58010758Seric 		(void) fclose(f);
58110758Seric 	}
58210758Seric 	return (NULL);
58310758Seric }
58416911Seric /*
58516911Seric **  MAPHOSTNAME -- turn a hostname into canonical form
58616911Seric **
58716911Seric **	Parameters:
58816911Seric **		hbuf -- a buffer containing a hostname.
58916911Seric **		hbsize -- the size of hbuf.
59016911Seric **
59116911Seric **	Returns:
59216911Seric **		none.
59316911Seric **
59416911Seric **	Side Effects:
59516911Seric **		Looks up the host specified in hbuf.  If it is not
59616911Seric **		the canonical name for that host, replace it with
59716911Seric **		the canonical name.  If the name is unknown, or it
59816911Seric **		is already the canonical name, leave it unchanged.
59916911Seric */
60010758Seric 
60116911Seric /*ARGSUSED*/
60216911Seric maphostname(hbuf, hbsize)
60316911Seric 	char *hbuf;
60416911Seric 	int hbsize;
60516911Seric {
60616911Seric 	return;
60716911Seric }
60816911Seric 
60916911Seric 
6105978Seric #endif DAEMON
611