X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/e78f68507356cd9f9a5bf9c03c9db61a7d00b9f4..157c1f04bd3b04cbdcef5efb3cb280d0e10f1e7f:/src/s_conf.c diff --git a/src/s_conf.c b/src/s_conf.c index ef704d2..c3df6fd 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -375,11 +375,10 @@ verify_access(struct Client *client_p, const char *username) else if(aconf->status & CONF_KILL) { if(ConfigFileEntry.kline_with_reason) - { sendto_one(client_p, form_str(ERR_YOUREBANNEDCREEP), - me.name, client_p->name, aconf->passwd); - } + me.name, client_p->name, + get_user_ban_reason(aconf)); add_reject(client_p, aconf->user, aconf->host); return (BANNED_CLIENT); } @@ -720,6 +719,7 @@ set_default_conf(void) ConfigFileEntry.pace_wait_simple = 1; ConfigFileEntry.short_motd = NO; ConfigFileEntry.no_oper_flood = NO; + ConfigFileEntry.true_no_oper_flood = NO; ConfigFileEntry.fname_userlog = NULL; ConfigFileEntry.fname_fuserlog = NULL; ConfigFileEntry.fname_operlog = NULL; @@ -1123,6 +1123,33 @@ get_printable_conf(struct ConfItem *aconf, char **name, char **host, *port = (int) aconf->port; } +char * +get_user_ban_reason(struct ConfItem *aconf) +{ + static char reasonbuf[BUFSIZE]; + + if (aconf->flags & CONF_FLAGS_TEMPORARY && + (aconf->status == CONF_KILL || aconf->status == CONF_DLINE)) + rb_snprintf(reasonbuf, sizeof reasonbuf, + "Temporary %c-line %d min. - ", + aconf->status == CONF_DLINE ? 'D' : 'K', + (aconf->hold - aconf->created) / 60); + else + reasonbuf[0] = '\0'; + if (aconf->passwd) + rb_strlcat(reasonbuf, aconf->passwd, sizeof reasonbuf); + else + rb_strlcat(reasonbuf, "No Reason", sizeof reasonbuf); + if (aconf->created) + { + rb_strlcat(reasonbuf, " (", sizeof reasonbuf); + rb_strlcat(reasonbuf, smalldate(aconf->created), + sizeof reasonbuf); + rb_strlcat(reasonbuf, ")", sizeof reasonbuf); + } + return reasonbuf; +} + void get_printable_kline(struct Client *source_p, struct ConfItem *aconf, char **host, char **reason, @@ -1131,8 +1158,8 @@ get_printable_kline(struct Client *source_p, struct ConfItem *aconf, static char null[] = ""; *host = EmptyString(aconf->host) ? null : aconf->host; - *reason = EmptyString(aconf->passwd) ? null : aconf->passwd; *user = EmptyString(aconf->user) ? null : aconf->user; + *reason = get_user_ban_reason(aconf); if(EmptyString(aconf->spasswd) || !IsOper(source_p)) *oper_reason = NULL;