#include "send.h"
#include "ircd.h"
#include "msg.h" /* XXX: MAXPARA */
+#include "operhash.h"
static char bandb_add_letter[LAST_BANDB_TYPE] = {
'K', 'D', 'X', 'R'
const char *suffix = "";
#endif
- rb_setenv("BANDB_DPATH", ConfigFileEntry.dpath, 1);
+ rb_setenv("BANDB_DBPATH", PKGLOCALSTATEDIR "/ban.db", 1);
if(bandb_path == NULL)
{
- rb_snprintf(fullpath, sizeof(fullpath), "%s/bandb%s", BINPATH, suffix);
+ rb_snprintf(fullpath, sizeof(fullpath), "%s/bandb%s", PKGLIBEXECDIR, suffix);
if(access(fullpath, X_OK) == -1)
{
if(access(fullpath, X_OK) == -1)
{
ilog(L_MAIN,
- "Unable to execute bandb in %s or %s/bin",
- BINPATH, ConfigFileEntry.dpath);
+ "Unable to execute bandb%s in %s or %s/bin",
+ suffix, PKGLIBEXECDIR, ConfigFileEntry.dpath);
return 0;
}
}
bandb_add(bandb_type type, struct Client *source_p, const char *mask1,
const char *mask2, const char *reason, const char *oper_reason, int perm)
{
+ if(bandb_helper == NULL)
+ return;
+
static char buf[BUFSIZE];
rb_snprintf(buf, sizeof(buf), "%c %s ", bandb_add_letter[type], mask1);
void
bandb_del(bandb_type type, const char *mask1, const char *mask2)
{
+ if(bandb_helper == NULL)
+ return;
+
static char buf[BUFSIZE];
buf[0] = '\0';
aconf->user = rb_strdup(parv[para++]);
aconf->host = rb_strdup(parv[para++]);
- /* We do not have the 'oper' field yet. */
- para++;
+ aconf->info.oper = operhash_add(parv[para++]);
switch (parv[0][0])
{
{
if(server_state_foreground)
fprintf(stderr, "bandb - bandb failure: %s\n", parv[1]);
-
+
ilog(L_MAIN, "bandb - bandb failure: %s", parv[1]);
sendto_realops_snomask(SNO_GENERAL, L_ALL, "bandb - bandb failure: %s", parv[1]);
exit(1);