extern time_t now;
+char hostbuf[BUFSIZ], *host;
+
int do_listen(char *port);
void do_reset_listen(void);
void clist_append(client *cp);
{
int status, i;
time_t tardy;
- char *port;
+ char *port, *p;
extern char *database;
struct stat stbuf;
sanity_check_queries();
+ /*
+ * Get moira server hostname for authentication
+ */
+ if (gethostname(hostbuf, sizeof(hostbuf)) < 0) {
+ com_err(whoami, errno, "Unable to get local hostname");
+ exit(1);
+ }
+ host = canonicalize_hostname(strsave(hostbuf));
+ for (p = host; *p && *p != '.'; p++)
+ if (isupper(*p))
+ *p = tolower(*p);
+ *p = 0;
+
/*
* Set up client array handler.
*/