* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: s_conf.c,v 1.2 2005/01/13 06:19:56 mmondor Exp $ */
+/* $Id: s_conf.c,v 1.3 2005/01/13 08:04:03 mmondor Exp $ */
#include "struct.h"
#include "common.h"
MyFree(ptr->ipmask);
MyFree(ptr->passwd);
MyFree(ptr->hostmask);
- MyFree(ptr->fakehost);
+#ifdef FAKEHOST
+ MyFree(ptr->fakehost);
+#endif
MyFree(ptr->class_name);
MyFree(ptr);
return;
}
MyFree(ptr->passwd);
MyFree(ptr->nick);
- MyFree(ptr->fakehost);
+#ifdef FAKEHOST
+ MyFree(ptr->fakehost);
+#endif
MyFree(ptr->class_name);
MyFree(ptr);
return;
tmp->type = NULL;
DupString(x->class_name, tmp->value);
}
- else if(tmp->type && (tmp->type->flag & SCONFF_MASK))
- {
- if (x->fakehost)
- {
- confparse_error("Multiple mask definitions", lnum);
- free_oper(x);
- return -1;
- }
- tmp->type = NULL;
- DupString(x->fakehost, tmp->value);
- }
+#ifdef FAKEHOST
+ else if(tmp->type && (tmp->type->flag & SCONFF_MASK))
+ {
+ if (x->fakehost)
+ {
+ confparse_error("Multiple mask definitions", lnum);
+ free_oper(x);
+ return -1;
+ }
+ tmp->type = NULL;
+ DupString(x->fakehost, tmp->value);
+ }
+#endif
}
if(!x->nick)
{
tmp->type = NULL;
}
- else if(tmp->type && (tmp->type->flag & SCONFF_MASK))
+#ifdef FAKEHOST
+ else if(tmp->type && (tmp->type->flag & SCONFF_MASK))
+ {
+ char *p = tmp->value;
+ int bad_dns = 0;
+ int dots = 0;
+
+ if(x->fakehost)
+ {
+ confparse_error("Multiple hostmask definitions", lnum);
+ free_allow(x);
+ return -1;
+ }
+ while (*p)
+ {
+ if (!IsAlnum(*p))
{
- char *p = tmp->value;
- int bad_dns = 0;
- int dots = 0;
- if(x->fakehost)
- {
- confparse_error("Multiple hostmask definitions", lnum);
- free_allow(x);
- return -1;
- }
- while (*p)
- {
- if (!IsAlnum(*p))
- {
#ifdef RFC1035_ANAL
- if ((*p != '-') && (*p != '.'))
+ if ((*p != '-') && (*p != '.'))
#else
- if ((*p != '-') && (*p != '.') &&
- (*p != '_') && (*p != '/'))
+ if ((*p != '-') && (*p != '.') &&
+ (*p != '_') && (*p != '/'))
#endif
- bad_dns = YES;
- }
- if (*p == '.')
- dots++;
- p++;
- }
- if (bad_dns || !dots)
- {
- confparse_error("Invalid hostmask encountered",lnum);
- free_allow(x);
- return -1;
- }
- tmp->type = NULL;
- DupString(x->fakehost, tmp->value);
- x->flags |= CONF_FLAGS_I_FAKE_HOST;
-
+ bad_dns = YES;
}
+ if (*p == '.')
+ dots++;
+ p++;
+ }
+ if (bad_dns || !dots)
+ {
+ confparse_error("Invalid hostmask encountered",lnum);
+ free_allow(x);
+ return -1;
+ }
+ tmp->type = NULL;
+ DupString(x->fakehost, tmp->value);
+ x->flags |= CONF_FLAGS_I_FAKE_HOST;
+ }
+#endif
}
if(!x->ipmask && !x->hostmask)
{
old_oper->hosts[i] = aoper->hosts[i];
old_oper->hosts[i] = NULL;
old_oper->passwd = aoper->passwd;
- MyFree(old_oper->fakehost);
- if (aoper->fakehost)
- DupString(old_oper->fakehost, aoper->fakehost);
- else
- old_oper->fakehost = NULL;
+#ifdef FAKEHOST
+ MyFree(old_oper->fakehost);
+ if (aoper->fakehost)
+ DupString(old_oper->fakehost, aoper->fakehost);
+ else
+ old_oper->fakehost = NULL;
+#endif
old_oper->class_name = aoper->class_name;
old_oper->class = find_class(aoper->class_name);
old_oper->class->refs++;