DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) mkinstalldirs \
INSTALL README compile config.guess config.sub install-sh \
- missing ylwrap ltmain.sh
+ missing ltmain.sh
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
#line 148 "config-parser.y" /* yacc.c:1646 */
{
MyFree(OptionsItem->pidfile);
- OptionsItem->pidfile = DupString((yyvsp[-1].string));
+ OptionsItem->pidfile = xstrdup((yyvsp[-1].string));
}
#line 1662 "config-parser.c" /* yacc.c:1646 */
break;
#line 159 "config-parser.y" /* yacc.c:1646 */
{
MyFree(OptionsItem->scanlog);
- OptionsItem->scanlog = DupString((yyvsp[-1].string));
+ OptionsItem->scanlog = xstrdup((yyvsp[-1].string));
}
#line 1679 "config-parser.c" /* yacc.c:1646 */
break;
#line 189 "config-parser.y" /* yacc.c:1646 */
{
MyFree(IRCItem->away);
- IRCItem->away = DupString((yyvsp[-1].string));
+ IRCItem->away = xstrdup((yyvsp[-1].string));
}
#line 1688 "config-parser.c" /* yacc.c:1646 */
break;
#line 195 "config-parser.y" /* yacc.c:1646 */
{
MyFree(IRCItem->kline);
- IRCItem->kline = DupString((yyvsp[-1].string));
+ IRCItem->kline = xstrdup((yyvsp[-1].string));
}
#line 1697 "config-parser.c" /* yacc.c:1646 */
break;
#line 201 "config-parser.y" /* yacc.c:1646 */
{
MyFree(IRCItem->mode);
- IRCItem->mode = DupString((yyvsp[-1].string));
+ IRCItem->mode = xstrdup((yyvsp[-1].string));
}
#line 1706 "config-parser.c" /* yacc.c:1646 */
break;
#line 207 "config-parser.y" /* yacc.c:1646 */
{
MyFree(IRCItem->nick);
- IRCItem->nick = DupString((yyvsp[-1].string));
+ IRCItem->nick = xstrdup((yyvsp[-1].string));
}
#line 1715 "config-parser.c" /* yacc.c:1646 */
break;
#line 213 "config-parser.y" /* yacc.c:1646 */
{
MyFree(IRCItem->nickserv);
- IRCItem->nickserv = DupString((yyvsp[-1].string));
+ IRCItem->nickserv = xstrdup((yyvsp[-1].string));
}
#line 1724 "config-parser.c" /* yacc.c:1646 */
break;
#line 219 "config-parser.y" /* yacc.c:1646 */
{
MyFree(IRCItem->oper);
- IRCItem->oper = DupString((yyvsp[-1].string));
+ IRCItem->oper = xstrdup((yyvsp[-1].string));
}
#line 1733 "config-parser.c" /* yacc.c:1646 */
break;
#line 225 "config-parser.y" /* yacc.c:1646 */
{
MyFree(IRCItem->password);
- IRCItem->password = DupString((yyvsp[-1].string));
+ IRCItem->password = xstrdup((yyvsp[-1].string));
}
#line 1742 "config-parser.c" /* yacc.c:1646 */
break;
#line 231 "config-parser.y" /* yacc.c:1646 */
{
node_t *node;
- node = node_create(DupString((yyvsp[-1].string)));
+ node = node_create(xstrdup((yyvsp[-1].string)));
list_add(IRCItem->performs, node);
}
#line 244 "config-parser.y" /* yacc.c:1646 */
{
MyFree(IRCItem->realname);
- IRCItem->realname = DupString((yyvsp[-1].string));
+ IRCItem->realname = xstrdup((yyvsp[-1].string));
}
#line 1770 "config-parser.c" /* yacc.c:1646 */
break;
#line 250 "config-parser.y" /* yacc.c:1646 */
{
MyFree(IRCItem->server);
- IRCItem->server = DupString((yyvsp[-1].string));
+ IRCItem->server = xstrdup((yyvsp[-1].string));
}
#line 1779 "config-parser.c" /* yacc.c:1646 */
break;
#line 256 "config-parser.y" /* yacc.c:1646 */
{
MyFree(IRCItem->username);
- IRCItem->username = DupString((yyvsp[-1].string));
+ IRCItem->username = xstrdup((yyvsp[-1].string));
}
#line 1788 "config-parser.c" /* yacc.c:1646 */
break;
#line 262 "config-parser.y" /* yacc.c:1646 */
{
MyFree(IRCItem->vhost);
- IRCItem->vhost = DupString((yyvsp[-1].string));
+ IRCItem->vhost = xstrdup((yyvsp[-1].string));
}
#line 1797 "config-parser.c" /* yacc.c:1646 */
break;
#line 268 "config-parser.y" /* yacc.c:1646 */
{
MyFree(IRCItem->connregex);
- IRCItem->connregex = DupString((yyvsp[-1].string));
+ IRCItem->connregex = xstrdup((yyvsp[-1].string));
}
#line 1806 "config-parser.c" /* yacc.c:1646 */
break;
item = MyMalloc(sizeof *item);
- item->name = DupString("");
- item->key = DupString("");
- item->invite = DupString("");
+ item->name = xstrdup("");
+ item->key = xstrdup("");
+ item->invite = xstrdup("");
node = node_create(item);
list_add(IRCItem->channels, node);
struct ChannelConf *item = tmp;
MyFree(item->name);
- item->name = DupString((yyvsp[-1].string));
+ item->name = xstrdup((yyvsp[-1].string));
}
#line 1837 "config-parser.c" /* yacc.c:1646 */
break;
struct ChannelConf *item = tmp;
MyFree(item->key);
- item->key = DupString((yyvsp[-1].string));
+ item->key = xstrdup((yyvsp[-1].string));
}
#line 1848 "config-parser.c" /* yacc.c:1646 */
break;
struct ChannelConf *item = tmp;
MyFree(item->invite);
- item->invite = DupString((yyvsp[-1].string));
+ item->invite = xstrdup((yyvsp[-1].string));
}
#line 1859 "config-parser.c" /* yacc.c:1646 */
break;
struct UserConf *item = (struct UserConf *) tmp;
node_t *node;
- node = node_create((void *) DupString((yyvsp[-1].string)));
+ node = node_create((void *) xstrdup((yyvsp[-1].string)));
list_add(item->masks, node);
}
struct UserConf *item = (struct UserConf *) tmp;
node_t *node;
- node = node_create((void *) DupString((yyvsp[-1].string)));
+ node = node_create((void *) xstrdup((yyvsp[-1].string)));
list_add(item->scanners, node);
}
item = MyMalloc(sizeof *item);
/* Setup ScannerConf defaults */
- item->name = DupString("undefined");
+ item->name = xstrdup("undefined");
if(LIST_SIZE(ScannerItemList) > 0)
{
olditem = ScannerItemList->tail->data;
- item->vhost = DupString(olditem->vhost);
+ item->vhost = xstrdup(olditem->vhost);
item->fd = olditem->fd;
- item->target_ip = DupString(olditem->target_ip);
+ item->target_ip = xstrdup(olditem->target_ip);
item->target_port = olditem->target_port;
item->timeout = olditem->timeout;
item->max_read = olditem->max_read;
}
else
{
- item->vhost = DupString("0.0.0.0");
+ item->vhost = xstrdup("0.0.0.0");
item->fd = 512;
- item->target_ip = DupString("127.0.0.1");
+ item->target_ip = xstrdup("127.0.0.1");
item->target_port = 6667;
item->timeout = 30;
item->max_read = 4096;
{
struct ScannerConf *item = (struct ScannerConf *) tmp;
MyFree(item->name);
- item->name = DupString((yyvsp[-1].string));
+ item->name = xstrdup((yyvsp[-1].string));
}
#line 1962 "config-parser.c" /* yacc.c:1646 */
break;
{
struct ScannerConf *item = (struct ScannerConf *) tmp;
MyFree(item->vhost);
- item->vhost = DupString((yyvsp[-1].string));
+ item->vhost = xstrdup((yyvsp[-1].string));
}
#line 1972 "config-parser.c" /* yacc.c:1646 */
break;
{
struct ScannerConf *item = (struct ScannerConf *) tmp;
MyFree(item->target_ip);
- item->target_ip = DupString((yyvsp[-1].string));
+ item->target_ip = xstrdup((yyvsp[-1].string));
}
#line 1982 "config-parser.c" /* yacc.c:1646 */
break;
#line 525 "config-parser.y" /* yacc.c:1646 */
{
MyFree(OpmItem->dnsbl_from);
- OpmItem->dnsbl_from = DupString((yyvsp[-1].string));
+ OpmItem->dnsbl_from = xstrdup((yyvsp[-1].string));
}
#line 2066 "config-parser.c" /* yacc.c:1646 */
break;
#line 531 "config-parser.y" /* yacc.c:1646 */
{
MyFree(OpmItem->dnsbl_to);
- OpmItem->dnsbl_to = DupString((yyvsp[-1].string));
+ OpmItem->dnsbl_to = xstrdup((yyvsp[-1].string));
}
#line 2075 "config-parser.c" /* yacc.c:1646 */
break;
#line 537 "config-parser.y" /* yacc.c:1646 */
{
MyFree(OpmItem->sendmail);
- OpmItem->sendmail = DupString((yyvsp[-1].string));
+ OpmItem->sendmail = xstrdup((yyvsp[-1].string));
}
#line 2084 "config-parser.c" /* yacc.c:1646 */
break;
item = MyMalloc(sizeof *item);
- item->name = DupString("");
- item->kline = DupString("");
+ item->name = xstrdup("");
+ item->kline = xstrdup("");
item->ban_unknown = 0;
item->type = A_BITMASK;
item->reply = list_create();
struct BlacklistConf *item = tmp;
MyFree(item->name);
- item->name = DupString((yyvsp[-1].string));
+ item->name = xstrdup((yyvsp[-1].string));
}
#line 2117 "config-parser.c" /* yacc.c:1646 */
break;
struct BlacklistConf *item = tmp;
MyFree(item->kline);
- item->kline = DupString((yyvsp[-1].string));
+ item->kline = xstrdup((yyvsp[-1].string));
}
#line 2128 "config-parser.c" /* yacc.c:1646 */
break;
item = MyMalloc(sizeof *item);
item->number = (yyvsp[-3].number);
- item->type = DupString((yyvsp[-1].string));
+ item->type = xstrdup((yyvsp[-1].string));
node = node_create(item);
list_add(blacklist->reply, node);
#line 637 "config-parser.y" /* yacc.c:1646 */
{
node_t *node;
- node = node_create(DupString((yyvsp[-1].string)));
+ node = node_create(xstrdup((yyvsp[-1].string)));
list_add(ExemptItem->masks, node);
}
options_pidfile: PIDFILE '=' STRING ';'
{
MyFree(OptionsItem->pidfile);
- OptionsItem->pidfile = DupString($3);
+ OptionsItem->pidfile = xstrdup($3);
};
options_dns_fdlimit: DNS_FDLIMIT '=' NUMBER ';'
options_scanlog: SCANLOG '=' STRING ';'
{
MyFree(OptionsItem->scanlog);
- OptionsItem->scanlog = DupString($3);
+ OptionsItem->scanlog = xstrdup($3);
};
/*************************** IRC BLOCK ***************************/
irc_away: AWAY '=' STRING ';'
{
MyFree(IRCItem->away);
- IRCItem->away = DupString($3);
+ IRCItem->away = xstrdup($3);
};
irc_kline: KLINE '=' STRING ';'
{
MyFree(IRCItem->kline);
- IRCItem->kline = DupString($3);
+ IRCItem->kline = xstrdup($3);
};
irc_mode: MODE '=' STRING ';'
{
MyFree(IRCItem->mode);
- IRCItem->mode = DupString($3);
+ IRCItem->mode = xstrdup($3);
};
irc_nick: NICK '=' STRING ';'
{
MyFree(IRCItem->nick);
- IRCItem->nick = DupString($3);
+ IRCItem->nick = xstrdup($3);
};
irc_nickserv: NICKSERV '=' STRING ';'
{
MyFree(IRCItem->nickserv);
- IRCItem->nickserv = DupString($3);
+ IRCItem->nickserv = xstrdup($3);
};
irc_oper: OPER '=' STRING ';'
{
MyFree(IRCItem->oper);
- IRCItem->oper = DupString($3);
+ IRCItem->oper = xstrdup($3);
};
irc_password: PASSWORD '=' STRING ';'
{
MyFree(IRCItem->password);
- IRCItem->password = DupString($3);
+ IRCItem->password = xstrdup($3);
};
irc_perform: PERFORM '=' STRING ';'
{
node_t *node;
- node = node_create(DupString($3));
+ node = node_create(xstrdup($3));
list_add(IRCItem->performs, node);
};
irc_realname: REALNAME '=' STRING ';'
{
MyFree(IRCItem->realname);
- IRCItem->realname = DupString($3);
+ IRCItem->realname = xstrdup($3);
};
irc_server: SERVER '=' STRING ';'
{
MyFree(IRCItem->server);
- IRCItem->server = DupString($3);
+ IRCItem->server = xstrdup($3);
};
irc_username: USERNAME '=' STRING ';'
{
MyFree(IRCItem->username);
- IRCItem->username = DupString($3);
+ IRCItem->username = xstrdup($3);
};
irc_vhost: VHOST '=' STRING ';'
{
MyFree(IRCItem->vhost);
- IRCItem->vhost = DupString($3);
+ IRCItem->vhost = xstrdup($3);
};
irc_connregex: CONNREGEX '=' STRING ';'
{
MyFree(IRCItem->connregex);
- IRCItem->connregex = DupString($3);
+ IRCItem->connregex = xstrdup($3);
};
item = MyMalloc(sizeof *item);
- item->name = DupString("");
- item->key = DupString("");
- item->invite = DupString("");
+ item->name = xstrdup("");
+ item->key = xstrdup("");
+ item->invite = xstrdup("");
node = node_create(item);
list_add(IRCItem->channels, node);
struct ChannelConf *item = tmp;
MyFree(item->name);
- item->name = DupString($3);
+ item->name = xstrdup($3);
};
channel_key: KEY '=' STRING ';'
struct ChannelConf *item = tmp;
MyFree(item->key);
- item->key = DupString($3);
+ item->key = xstrdup($3);
};
channel_invite: INVITE '=' STRING ';'
struct ChannelConf *item = tmp;
MyFree(item->invite);
- item->invite = DupString($3);
+ item->invite = xstrdup($3);
};
/*************************** USER BLOCK ***************************/
struct UserConf *item = (struct UserConf *) tmp;
node_t *node;
- node = node_create((void *) DupString($3));
+ node = node_create((void *) xstrdup($3));
list_add(item->masks, node);
};
struct UserConf *item = (struct UserConf *) tmp;
node_t *node;
- node = node_create((void *) DupString($3));
+ node = node_create((void *) xstrdup($3));
list_add(item->scanners, node);
};
item = MyMalloc(sizeof *item);
/* Setup ScannerConf defaults */
- item->name = DupString("undefined");
+ item->name = xstrdup("undefined");
if(LIST_SIZE(ScannerItemList) > 0)
{
olditem = ScannerItemList->tail->data;
- item->vhost = DupString(olditem->vhost);
+ item->vhost = xstrdup(olditem->vhost);
item->fd = olditem->fd;
- item->target_ip = DupString(olditem->target_ip);
+ item->target_ip = xstrdup(olditem->target_ip);
item->target_port = olditem->target_port;
item->timeout = olditem->timeout;
item->max_read = olditem->max_read;
}
else
{
- item->vhost = DupString("0.0.0.0");
+ item->vhost = xstrdup("0.0.0.0");
item->fd = 512;
- item->target_ip = DupString("127.0.0.1");
+ item->target_ip = xstrdup("127.0.0.1");
item->target_port = 6667;
item->timeout = 30;
item->max_read = 4096;
{
struct ScannerConf *item = (struct ScannerConf *) tmp;
MyFree(item->name);
- item->name = DupString($3);
+ item->name = xstrdup($3);
};
scanner_vhost: VHOST '=' STRING ';'
{
struct ScannerConf *item = (struct ScannerConf *) tmp;
MyFree(item->vhost);
- item->vhost = DupString($3);
+ item->vhost = xstrdup($3);
};
scanner_target_ip: TARGET_IP '=' STRING ';'
{
struct ScannerConf *item = (struct ScannerConf *) tmp;
MyFree(item->target_ip);
- item->target_ip = DupString($3);
+ item->target_ip = xstrdup($3);
};
scanner_target_string: TARGET_STRING '=' STRING ';'
opm_dnsbl_from: DNSBL_FROM '=' STRING ';'
{
MyFree(OpmItem->dnsbl_from);
- OpmItem->dnsbl_from = DupString($3);
+ OpmItem->dnsbl_from = xstrdup($3);
};
opm_dnsbl_to: DNSBL_TO '=' STRING ';'
{
MyFree(OpmItem->dnsbl_to);
- OpmItem->dnsbl_to = DupString($3);
+ OpmItem->dnsbl_to = xstrdup($3);
};
opm_sendmail: SENDMAIL '=' STRING ';'
{
MyFree(OpmItem->sendmail);
- OpmItem->sendmail = DupString($3);
+ OpmItem->sendmail = xstrdup($3);
};
/************************** BLACKLIST BLOCK *************************/
item = MyMalloc(sizeof *item);
- item->name = DupString("");
- item->kline = DupString("");
+ item->name = xstrdup("");
+ item->kline = xstrdup("");
item->ban_unknown = 0;
item->type = A_BITMASK;
item->reply = list_create();
struct BlacklistConf *item = tmp;
MyFree(item->name);
- item->name = DupString($3);
+ item->name = xstrdup($3);
};
blacklist_kline: KLINE '=' STRING ';' {
struct BlacklistConf *item = tmp;
MyFree(item->kline);
- item->kline = DupString($3);
+ item->kline = xstrdup($3);
};
blacklist_type: TYPE '=' STRING ';' {
item = MyMalloc(sizeof *item);
item->number = $1;
- item->type = DupString($3);
+ item->type = xstrdup($3);
node = node_create(item);
list_add(blacklist->reply, node);
exempt_mask: MASK '=' STRING ';'
{
node_t *node;
- node = node_create(DupString($3));
+ node = node_create(xstrdup($3));
list_add(ExemptItem->masks, node);
};
{
/* Setup IRC Block Defaults */
- IRCItem->mode = DupString("+cs");
- IRCItem->nick = DupString("hopm");
- IRCItem->nickserv = DupString("");
- IRCItem->password = DupString("");
+ IRCItem->mode = xstrdup("+cs");
+ IRCItem->nick = xstrdup("hopm");
+ IRCItem->nickserv = xstrdup("");
+ IRCItem->password = xstrdup("");
IRCItem->port = 6667;
- IRCItem->oper = DupString("undefined");
- IRCItem->username = DupString("hopm");
- IRCItem->realname = DupString("Hybrid Open Proxy Monitor");
- IRCItem->server = DupString("myserver.blitzed.org");
- IRCItem->vhost = DupString("");
- IRCItem->connregex = DupString("\\*\\*\\* Notice -- Client connecting: ([^ ]+) \\(([^@]+)@([^\\)]+)\\) \\[([0-9\\.]+)\\].*");
- IRCItem->kline = DupString("KLINE %u@%h :Open Proxy found on your host.");
+ IRCItem->oper = xstrdup("undefined");
+ IRCItem->username = xstrdup("hopm");
+ IRCItem->realname = xstrdup("Hybrid Open Proxy Monitor");
+ IRCItem->server = xstrdup("myserver.blitzed.org");
+ IRCItem->vhost = xstrdup("");
+ IRCItem->connregex = xstrdup("\\*\\*\\* Notice -- Client connecting: ([^ ]+) \\(([^@]+)@([^\\)]+)\\) \\[([0-9\\.]+)\\].*");
+ IRCItem->kline = xstrdup("KLINE %u@%h :Open Proxy found on your host.");
/* Setup options block defaults */
OptionsItem->negcache = 0; /* 0 disabled negcache */
- OptionsItem->pidfile = DupString("hopm.pid");
+ OptionsItem->pidfile = xstrdup("hopm.pid");
OptionsItem->dns_fdlimit = 50;
OptionsItem->scanlog = NULL;
/* Setup OPM block defaults */
- OpmItem->sendmail = DupString("/usr/sbin/sendmail");
- OpmItem->dnsbl_from = DupString("");
- OpmItem->dnsbl_to = DupString("");
+ OpmItem->sendmail = xstrdup("/usr/sbin/sendmail");
+ OpmItem->dnsbl_from = xstrdup("");
+ OpmItem->dnsbl_to = xstrdup("");
}
void yyerror(const char *str)
{
- log_printf("CONFIG -> %s: line %d, buf: %s", str, linenum,);
+ log_printf("CONFIG -> %s: line %d", str, linenum);
exit(EXIT_FAILURE);
}
int i, len;
nick = username = hostname = NULL;
- tmp = DupString(source);
+ tmp = xstrdup(source);
len = strlen(tmp);
nick = tmp;
ret = MyMalloc(sizeof *ret);
- ret->irc_nick = DupString(nick);
- ret->irc_username = DupString(username);
- ret->irc_hostname = DupString(hostname);
+ ret->irc_nick = xstrdup(nick);
+ ret->irc_username = xstrdup(username);
+ ret->irc_hostname = xstrdup(hostname);
MyFree(tmp);
*var = NULL;
}
-
-char *DupString(const char *y)
+void *
+xstrdup(const char *s)
{
- char *x;
+ void *ret = malloc(strlen(s) + 1);
- x = malloc(strlen(y) + 1);
- assert(x);
- strcpy(x, y);
+ assert(ret);
+ strcpy(ret, s);
- return x;
+ return ret;
}
extern void *MyMalloc(size_t bytes);
extern void _MyFree(void **var);
-char *DupString(const char *y);
+extern void *xstrdup(const char *);
#endif /* MALLOC_H */
ret->type = type;
if(param != NULL)
- ret->param = DupString(param);
+ ret->param = xstrdup(param);
else
ret->param = NULL;
- ret->irc_nick = (char *) DupString(irc_nick);
+ ret->irc_nick = xstrdup(irc_nick);
ret->target = target; /* FIXME: This needs fixed if rehash is implemented */
time(&(ret->added));
/* Build the scanner */
scs->scanner = opm_create();
- scs->name = (char *) DupString(sc->name);
+ scs->name = xstrdup(sc->name);
scs->masks = list_create();
/* Setup configuration */
"[%s]", mask, scannername);
}
- node = node_create(DupString(mask));
+ node = node_create(xstrdup(mask));
list_add(scs->masks, node);
}
break;
ss = MyMalloc(sizeof *ss);
- ss->irc_nick = (char *) DupString(user[0]);
- ss->irc_username = (char *) DupString(user[1]);
- ss->irc_hostname = (char *) DupString(user[2]);
- ss->ip = (char *) DupString(user[3]);
- ss->proof = (char *) DupString(msg);
+ ss->irc_nick = xstrdup(user[0]);
+ ss->irc_username = xstrdup(user[1]);
+ ss->irc_hostname = xstrdup(user[2]);
+ ss->ip = xstrdup(user[3]);
+ ss->proof = xstrdup(msg);
ss->remote = opm_remote_create(ss->ip);
ss->scans = 0;
ss->irc_hostname = NULL;
ss->proof = NULL;
- ss->ip = DupString(ip);
+ ss->ip = xstrdup(ip);
ss->remote = opm_remote_create(ss->ip);
ss->remote->data = ss;