]> jfr.im git - irc/rqf/shadowircd.git/blob - modules/core/m_server.c
[svn] Merge old trunk r2817:
[irc/rqf/shadowircd.git] / modules / core / m_server.c
1 /*
2 * ircd-ratbox: A slightly useful ircd.
3 * m_server.c: Introduces a server.
4 *
5 * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
6 * Copyright (C) 1996-2002 Hybrid Development Team
7 * Copyright (C) 2002-2005 ircd-ratbox development team
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 * USA
23 *
24 * $Id: m_server.c 3291 2007-03-28 14:30:10Z jilles $
25 */
26
27 #include "stdinc.h"
28 #include "tools.h"
29 #include "client.h" /* client struct */
30 #include "common.h" /* TRUE bleah */
31 #include "event.h"
32 #include "hash.h" /* add_to_client_hash */
33 #include "irc_string.h"
34 #include "ircd.h" /* me */
35 #include "numeric.h" /* ERR_xxx */
36 #include "s_conf.h" /* struct ConfItem */
37 #include "s_newconf.h"
38 #include "s_log.h" /* log level defines */
39 #include "s_serv.h" /* server_estab, check_server */
40 #include "s_stats.h" /* ServerStats */
41 #include "scache.h" /* find_or_add */
42 #include "send.h" /* sendto_one */
43 #include "msg.h"
44 #include "parse.h"
45 #include "modules.h"
46
47 static int mr_server(struct Client *, struct Client *, int, const char **);
48 static int ms_server(struct Client *, struct Client *, int, const char **);
49 static int ms_sid(struct Client *, struct Client *, int, const char **);
50
51 struct Message server_msgtab = {
52 "SERVER", 0, 0, 0, MFLG_SLOW | MFLG_UNREG,
53 {{mr_server, 4}, mg_reg, mg_ignore, {ms_server, 4}, mg_ignore, mg_reg}
54 };
55 struct Message sid_msgtab = {
56 "SID", 0, 0, 0, MFLG_SLOW,
57 {mg_ignore, mg_reg, mg_ignore, {ms_sid, 5}, mg_ignore, mg_reg}
58 };
59
60 mapi_clist_av1 server_clist[] = { &server_msgtab, &sid_msgtab, NULL };
61
62 DECLARE_MODULE_AV1(server, NULL, NULL, server_clist, NULL, NULL, "$Revision: 3291 $");
63
64 int bogus_host(const char *host);
65 static int set_server_gecos(struct Client *, const char *);
66
67 /*
68 * mr_server - SERVER message handler
69 * parv[0] = sender prefix
70 * parv[1] = servername
71 * parv[2] = serverinfo/hopcount
72 * parv[3] = serverinfo
73 */
74 static int
75 mr_server(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
76 {
77 char info[REALLEN + 1];
78 const char *name;
79 struct Client *target_p;
80 int hop;
81
82 name = parv[1];
83 hop = atoi(parv[2]);
84 strlcpy(info, parv[3], sizeof(info));
85
86 if (IsHandshake(client_p) && irccmp(client_p->name, name))
87 {
88 sendto_realops_snomask(SNO_GENERAL, is_remote_connect(client_p) ? L_NETWIDE : L_ALL,
89 "Server %s has unexpected name %s",
90 get_server_name(client_p, HIDE_IP), name);
91 ilog(L_SERVER, "Server %s has unexpected name %s",
92 log_client_name(client_p, SHOW_IP), name);
93 exit_client(client_p, client_p, client_p, "Server name mismatch");
94 return 0;
95 }
96
97 /*
98 * Reject a direct nonTS server connection if we're TS_ONLY -orabidoo
99 */
100 if(!DoesTS(client_p))
101 {
102 sendto_realops_snomask(SNO_GENERAL, L_ALL, "Link %s dropped, non-TS server",
103 get_server_name(client_p, HIDE_IP));
104 exit_client(client_p, client_p, client_p, "Non-TS server");
105 return 0;
106 }
107
108 if(bogus_host(name))
109 {
110 exit_client(client_p, client_p, client_p, "Bogus server name");
111 return 0;
112 }
113
114 /* Now we just have to call check_server and everything should be
115 * check for us... -A1kmm. */
116 switch (check_server(name, client_p))
117 {
118 case -1:
119 if(ConfigFileEntry.warn_no_nline)
120 {
121 sendto_realops_snomask(SNO_GENERAL, L_ALL,
122 "Unauthorised server connection attempt from %s: "
123 "No entry for servername %s",
124 get_server_name(client_p, HIDE_IP), name);
125
126 ilog(L_SERVER, "Access denied, no connect block for server %s%s",
127 EmptyString(client_p->name) ? name : "",
128 log_client_name(client_p, SHOW_IP));
129 }
130
131 exit_client(client_p, client_p, client_p, "Invalid servername.");
132 return 0;
133 /* NOT REACHED */
134 break;
135
136 case -2:
137 sendto_realops_snomask(SNO_GENERAL, L_ALL,
138 "Unauthorised server connection attempt from %s: "
139 "Bad password for server %s",
140 get_server_name(client_p, HIDE_IP), name);
141
142 ilog(L_SERVER, "Access denied, invalid password for server %s%s",
143 EmptyString(client_p->name) ? name : "",
144 log_client_name(client_p, SHOW_IP));
145
146 exit_client(client_p, client_p, client_p, "Invalid password.");
147 return 0;
148 /* NOT REACHED */
149 break;
150
151 case -3:
152 sendto_realops_snomask(SNO_GENERAL, L_ALL,
153 "Unauthorised server connection attempt from %s: "
154 "Invalid host for server %s",
155 get_server_name(client_p, HIDE_IP), name);
156
157 ilog(L_SERVER, "Access denied, invalid host for server %s%s",
158 EmptyString(client_p->name) ? name : "",
159 log_client_name(client_p, SHOW_IP));
160
161 exit_client(client_p, client_p, client_p, "Invalid host.");
162 return 0;
163 /* NOT REACHED */
164 break;
165
166 /* servername is > HOSTLEN */
167 case -4:
168 sendto_realops_snomask(SNO_GENERAL, L_ALL,
169 "Invalid servername %s from %s",
170 name, get_server_name(client_p, HIDE_IP));
171 ilog(L_SERVER, "Access denied, invalid servername from %s",
172 log_client_name(client_p, SHOW_IP));
173
174 exit_client(client_p, client_p, client_p, "Invalid servername.");
175 return 0;
176 /* NOT REACHED */
177 break;
178 }
179
180 if((target_p = find_server(NULL, name)))
181 {
182 /*
183 * This link is trying feed me a server that I already have
184 * access through another path -- multiple paths not accepted
185 * currently, kill this link immediately!!
186 *
187 * Rather than KILL the link which introduced it, KILL the
188 * youngest of the two links. -avalon
189 *
190 * Definitely don't do that here. This is from an unregistered
191 * connect - A1kmm.
192 */
193 sendto_realops_snomask(SNO_GENERAL, L_ALL,
194 "Attempt to re-introduce server %s from %s",
195 name, get_server_name(client_p, HIDE_IP));
196 ilog(L_SERVER, "Attempt to re-introduce server %s from %s",
197 name, log_client_name(client_p, SHOW_IP));
198
199 sendto_one(client_p, "ERROR :Server already exists.");
200 exit_client(client_p, client_p, client_p, "Server Exists");
201 return 0;
202 }
203
204 if(has_id(client_p) && (target_p = find_id(client_p->id)) != NULL)
205 {
206 sendto_realops_snomask(SNO_GENERAL, L_ALL,
207 "Attempt to re-introduce SID %s from %s%s",
208 client_p->id,
209 EmptyString(client_p->name) ? name : "",
210 get_server_name(client_p, HIDE_IP));
211 ilog(L_SERVER, "Attempt to re-introduce SID %s from %s%s",
212 client_p->id,
213 EmptyString(client_p->name) ? name : "",
214 log_client_name(client_p, SHOW_IP));
215
216 sendto_one(client_p, "ERROR :SID already exists.");
217 exit_client(client_p, client_p, client_p, "SID Exists");
218 return 0;
219 }
220
221 /*
222 * if we are connecting (Handshake), we already have the name from the
223 * C:line in client_p->name
224 */
225
226 strlcpy(client_p->name, name, sizeof(client_p->name));
227 set_server_gecos(client_p, info);
228 client_p->hopcount = hop;
229 server_estab(client_p);
230
231 return 0;
232 }
233
234 /*
235 * ms_server - SERVER message handler
236 * parv[0] = sender prefix
237 * parv[1] = servername
238 * parv[2] = serverinfo/hopcount
239 * parv[3] = serverinfo
240 */
241 static int
242 ms_server(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
243 {
244 char info[REALLEN + 1];
245 /* same size as in s_misc.c */
246 const char *name;
247 struct Client *target_p;
248 struct remote_conf *hub_p;
249 hook_data_client hdata;
250 int hop;
251 int hlined = 0;
252 int llined = 0;
253 dlink_node *ptr;
254
255 name = parv[1];
256 hop = atoi(parv[2]);
257 strlcpy(info, parv[3], sizeof(info));
258
259 if((target_p = find_server(NULL, name)))
260 {
261 /*
262 * This link is trying feed me a server that I already have
263 * access through another path -- multiple paths not accepted
264 * currently, kill this link immediately!!
265 *
266 * Rather than KILL the link which introduced it, KILL the
267 * youngest of the two links. -avalon
268 *
269 * I think that we should exit the link itself, not the introducer,
270 * and we should always exit the most recently received(i.e. the
271 * one we are receiving this SERVER for. -A1kmm
272 *
273 * You *cant* do this, if you link somewhere, it bursts you a server
274 * that already exists, then sends you a client burst, you squit the
275 * server, but you keep getting the burst of clients on a server that
276 * doesnt exist, although ircd can handle it, its not a realistic
277 * solution.. --fl_
278 */
279 /* It is behind a host-masked server. Completely ignore the
280 * server message(don't propagate or we will delink from whoever
281 * we propagate to). -A1kmm */
282 if(irccmp(target_p->name, name) && target_p->from == client_p)
283 return 0;
284
285 sendto_one(client_p, "ERROR :Server %s already exists", name);
286
287 sendto_realops_snomask(SNO_GENERAL, L_ALL,
288 "Link %s cancelled, server %s already exists",
289 get_server_name(client_p, SHOW_IP), name);
290 ilog(L_SERVER, "Link %s cancelled, server %s already exists",
291 client_p->name, name);
292
293 exit_client(client_p, client_p, &me, "Server Exists");
294 return 0;
295 }
296
297 /*
298 * User nicks never have '.' in them and server names
299 * must always have '.' in them.
300 */
301 if(strchr(name, '.') == NULL)
302 {
303 /*
304 * Server trying to use the same name as a person. Would
305 * cause a fair bit of confusion. Enough to make it hellish
306 * for a while and servers to send stuff to the wrong place.
307 */
308 sendto_one(client_p, "ERROR :Nickname %s already exists!", name);
309 sendto_realops_snomask(SNO_GENERAL, L_ALL,
310 "Link %s cancelled: Server/nick collision on %s",
311 get_server_name(client_p, HIDE_IP), name);
312 ilog(L_SERVER, "Link %s cancelled: Server/nick collision on %s",
313 client_p->name, name);
314
315 exit_client(client_p, client_p, client_p, "Nick as Server");
316 return 0;
317 }
318
319 /*
320 * Server is informing about a new server behind
321 * this link. Create REMOTE server structure,
322 * add it to list and propagate word to my other
323 * server links...
324 */
325 if(parc == 1 || EmptyString(info))
326 {
327 sendto_one(client_p, "ERROR :No server info specified for %s", name);
328 return 0;
329 }
330
331 /*
332 * See if the newly found server is behind a guaranteed
333 * leaf. If so, close the link.
334 *
335 */
336 DLINK_FOREACH(ptr, hubleaf_conf_list.head)
337 {
338 hub_p = ptr->data;
339
340 if(match(hub_p->server, client_p->name) && match(hub_p->host, name))
341 {
342 if(hub_p->flags & CONF_HUB)
343 hlined++;
344 else
345 llined++;
346 }
347 }
348
349 /* Ok, this way this works is
350 *
351 * A server can have a CONF_HUB allowing it to introduce servers
352 * behind it.
353 *
354 * connect {
355 * name = "irc.bighub.net";
356 * hub_mask="*";
357 * ...
358 *
359 * That would allow "irc.bighub.net" to introduce anything it wanted..
360 *
361 * However
362 *
363 * connect {
364 * name = "irc.somehub.fi";
365 * hub_mask="*";
366 * leaf_mask="*.edu";
367 *...
368 * Would allow this server in finland to hub anything but
369 * .edu's
370 */
371
372 /* Ok, check client_p can hub the new server, and make sure it's not a LL */
373 if(!hlined)
374 {
375 /* OOOPs nope can't HUB */
376 sendto_realops_snomask(SNO_GENERAL, L_ALL, "Non-Hub link %s introduced %s.",
377 get_server_name(client_p, HIDE_IP), name);
378 ilog(L_SERVER, "Non-Hub link %s introduced %s.",
379 client_p->name, name);
380
381 exit_client(NULL, client_p, &me, "No matching hub_mask.");
382 return 0;
383 }
384
385 /* Check for the new server being leafed behind this HUB */
386 if(llined)
387 {
388 /* OOOPs nope can't HUB this leaf */
389 sendto_realops_snomask(SNO_GENERAL, L_ALL,
390 "Link %s introduced leafed server %s.",
391 get_server_name(client_p, HIDE_IP), name);
392 ilog(L_SERVER, "Link %s introduced leafed server %s.",
393 client_p->name, name);
394
395 exit_client(NULL, client_p, &me, "Leafed Server.");
396 return 0;
397 }
398
399
400
401 if(strlen(name) > HOSTLEN)
402 {
403 sendto_realops_snomask(SNO_GENERAL, L_ALL,
404 "Link %s introduced server with invalid servername %s",
405 get_server_name(client_p, HIDE_IP), name);
406 ilog(L_SERVER, "Link %s introduced server with invalid servername %s",
407 client_p->name, name);
408
409 exit_client(NULL, client_p, &me, "Invalid servername introduced.");
410 return 0;
411 }
412
413 target_p = make_client(client_p);
414 make_server(target_p);
415 target_p->hopcount = hop;
416
417 strlcpy(target_p->name, name, sizeof(target_p->name));
418
419 set_server_gecos(target_p, info);
420
421 target_p->serv->up = find_or_add(source_p->name);
422
423 if(has_id(source_p))
424 target_p->serv->upid = source_p->id;
425
426 target_p->servptr = source_p;
427
428 SetServer(target_p);
429
430 dlinkAddTail(target_p, &target_p->node, &global_client_list);
431 dlinkAddTailAlloc(target_p, &global_serv_list);
432 add_to_client_hash(target_p->name, target_p);
433 dlinkAdd(target_p, &target_p->lnode, &target_p->servptr->serv->servers);
434
435 sendto_server(client_p, NULL, NOCAPS, NOCAPS,
436 ":%s SERVER %s %d :%s%s",
437 source_p->name, target_p->name, target_p->hopcount + 1,
438 IsHidden(target_p) ? "(H) " : "", target_p->info);
439
440 sendto_realops_snomask(SNO_EXTERNAL, L_ALL,
441 "Server %s being introduced by %s", target_p->name, source_p->name);
442
443 /* quick, dirty EOB. you know you love it. */
444 sendto_one(target_p, ":%s PING %s %s", get_id(&me, target_p), me.name, target_p->name);
445
446 hdata.client = source_p;
447 hdata.target = target_p;
448 call_hook(h_server_introduced, &hdata);
449
450 return 0;
451 }
452
453 static int
454 ms_sid(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
455 {
456 struct Client *target_p;
457 struct remote_conf *hub_p;
458 hook_data_client hdata;
459 dlink_node *ptr;
460 int hop;
461 int hlined = 0;
462 int llined = 0;
463
464 hop = atoi(parv[2]);
465
466 /* collision on the name? */
467 if((target_p = find_server(NULL, parv[1])) != NULL)
468 {
469 sendto_one(client_p, "ERROR :Server %s already exists", parv[1]);
470 sendto_realops_snomask(SNO_GENERAL, L_ALL,
471 "Link %s cancelled, server %s already exists",
472 get_server_name(client_p, SHOW_IP), parv[1]);
473 ilog(L_SERVER, "Link %s cancelled, server %s already exists",
474 client_p->name, parv[1]);
475
476 exit_client(NULL, client_p, &me, "Server Exists");
477 return 0;
478 }
479
480 /* collision on the SID? */
481 if((target_p = find_id(parv[3])) != NULL)
482 {
483 sendto_one(client_p, "ERROR :SID %s already exists", parv[3]);
484 sendto_realops_snomask(SNO_GENERAL, L_ALL,
485 "Link %s cancelled, SID %s already exists",
486 get_server_name(client_p, SHOW_IP), parv[3]);
487 ilog(L_SERVER, "Link %s cancelled, SID %s already exists",
488 client_p->name, parv[3]);
489
490 exit_client(NULL, client_p, &me, "Server Exists");
491 return 0;
492 }
493
494 if(bogus_host(parv[1]) || strlen(parv[1]) > HOSTLEN)
495 {
496 sendto_one(client_p, "ERROR :Invalid servername");
497 sendto_realops_snomask(SNO_GENERAL, L_ALL,
498 "Link %s cancelled, servername %s invalid",
499 get_server_name(client_p, SHOW_IP), parv[1]);
500 ilog(L_SERVER, "Link %s cancelled, servername %s invalid",
501 client_p->name, parv[1]);
502
503 exit_client(NULL, client_p, &me, "Bogus server name");
504 return 0;
505 }
506
507 if(!IsDigit(parv[3][0]) || !IsIdChar(parv[3][1]) ||
508 !IsIdChar(parv[3][2]) || parv[3][3] != '\0')
509 {
510 sendto_one(client_p, "ERROR :Invalid SID");
511 sendto_realops_snomask(SNO_GENERAL, L_ALL,
512 "Link %s cancelled, SID %s invalid",
513 get_server_name(client_p, SHOW_IP), parv[3]);
514 ilog(L_SERVER, "Link %s cancelled, SID %s invalid",
515 client_p->name, parv[3]);
516
517 exit_client(NULL, client_p, &me, "Bogus SID");
518 return 0;
519 }
520
521 /* for the directly connected server:
522 * H: allows it to introduce a server matching that mask
523 * L: disallows it introducing a server matching that mask
524 */
525 DLINK_FOREACH(ptr, hubleaf_conf_list.head)
526 {
527 hub_p = ptr->data;
528
529 if(match(hub_p->server, client_p->name) && match(hub_p->host, parv[1]))
530 {
531 if(hub_p->flags & CONF_HUB)
532 hlined++;
533 else
534 llined++;
535 }
536 }
537
538 /* no matching hub_mask */
539 if(!hlined)
540 {
541 sendto_one(client_p, "ERROR :No matching hub_mask");
542 sendto_realops_snomask(SNO_GENERAL, L_ALL,
543 "Non-Hub link %s introduced %s.",
544 get_server_name(client_p, SHOW_IP), parv[1]);
545 ilog(L_SERVER, "Non-Hub link %s introduced %s.",
546 client_p->name, parv[1]);
547 exit_client(NULL, client_p, &me, "No matching hub_mask.");
548 return 0;
549 }
550
551 /* matching leaf_mask */
552 if(llined)
553 {
554 sendto_one(client_p, "ERROR :Matching leaf_mask");
555 sendto_realops_snomask(SNO_GENERAL, L_ALL,
556 "Link %s introduced leafed server %s.",
557 get_server_name(client_p, SHOW_IP), parv[1]);
558 ilog(L_SERVER, "Link %s introduced leafed server %s.",
559 client_p->name, parv[1]);
560 exit_client(NULL, client_p, &me, "Leafed Server.");
561 return 0;
562 }
563
564 /* ok, alls good */
565 target_p = make_client(client_p);
566 make_server(target_p);
567
568 strlcpy(target_p->name, parv[1], sizeof(target_p->name));
569 target_p->hopcount = atoi(parv[2]);
570 strcpy(target_p->id, parv[3]);
571 set_server_gecos(target_p, parv[4]);
572
573 target_p->serv->up = find_or_add(source_p->name);
574
575 if(has_id(source_p))
576 target_p->serv->upid = source_p->id;
577
578 target_p->servptr = source_p;
579 SetServer(target_p);
580
581 dlinkAddTail(target_p, &target_p->node, &global_client_list);
582 dlinkAddTailAlloc(target_p, &global_serv_list);
583 add_to_client_hash(target_p->name, target_p);
584 add_to_id_hash(target_p->id, target_p);
585 dlinkAdd(target_p, &target_p->lnode, &target_p->servptr->serv->servers);
586
587 sendto_server(client_p, NULL, CAP_TS6, NOCAPS,
588 ":%s SID %s %d %s :%s%s",
589 source_p->id, target_p->name, target_p->hopcount + 1,
590 target_p->id, IsHidden(target_p) ? "(H) " : "", target_p->info);
591 sendto_server(client_p, NULL, NOCAPS, CAP_TS6,
592 ":%s SERVER %s %d :%s%s",
593 source_p->name, target_p->name, target_p->hopcount + 1,
594 IsHidden(target_p) ? "(H) " : "", target_p->info);
595
596 sendto_realops_snomask(SNO_EXTERNAL, L_ALL,
597 "Server %s being introduced by %s", target_p->name, source_p->name);
598
599 /* quick, dirty EOB. you know you love it. */
600 sendto_one(target_p, ":%s PING %s %s",
601 get_id(&me, target_p), me.name, get_id(target_p, target_p));
602
603 hdata.client = source_p;
604 hdata.target = target_p;
605 call_hook(h_server_introduced, &hdata);
606
607 return 0;
608 }
609
610 /* set_server_gecos()
611 *
612 * input - pointer to client
613 * output - none
614 * side effects - servers gecos field is set
615 */
616 static int
617 set_server_gecos(struct Client *client_p, const char *info)
618 {
619 /* check the info for [IP] */
620 if(info[0])
621 {
622 char *p;
623 char *s;
624 char *t;
625
626 s = LOCAL_COPY(info);
627
628 /* we should only check the first word for an ip */
629 if((p = strchr(s, ' ')))
630 *p = '\0';
631
632 /* check for a ] which would symbolise an [IP] */
633 if((t = strchr(s, ']')))
634 {
635 /* set s to after the first space */
636 if(p)
637 s = ++p;
638 else
639 s = NULL;
640 }
641 /* no ], put the space back */
642 else if(p)
643 *p = ' ';
644
645 /* p may have been set to a trailing space, so check s exists and that
646 * it isnt \0 */
647 if(s && (*s != '\0'))
648 {
649 /* a space? if not (H) could be the last part of info.. */
650 if((p = strchr(s, ' ')))
651 *p = '\0';
652
653 /* check for (H) which is a hidden server */
654 if(!strcmp(s, "(H)"))
655 {
656 SetHidden(client_p);
657
658 /* if there was no space.. theres nothing to set info to */
659 if(p)
660 s = ++p;
661 else
662 s = NULL;
663 }
664 else if(p)
665 *p = ' ';
666
667 /* if there was a trailing space, s could point to \0, so check */
668 if(s && (*s != '\0'))
669 {
670 strlcpy(client_p->info, s, sizeof(client_p->info));
671 return 1;
672 }
673 }
674 }
675
676 strlcpy(client_p->info, "(Unknown Location)", sizeof(client_p->info));
677
678 return 1;
679 }
680
681 /*
682 * bogus_host
683 *
684 * inputs - hostname
685 * output - 1 if a bogus hostname input, 0 if its valid
686 * side effects - none
687 */
688 int
689 bogus_host(const char *host)
690 {
691 int bogus_server = 0;
692 const char *s;
693 int dots = 0;
694
695 for(s = host; *s; s++)
696 {
697 if(!IsServChar(*s))
698 {
699 bogus_server = 1;
700 break;
701 }
702 if('.' == *s)
703 ++dots;
704 }
705
706 if(!dots || bogus_server)
707 return 1;
708
709 return 0;
710 }