Spring cleaning redux:

- Implemented changes suggested by Jilles
- Remove some unused parameters in functions
- Remove some unused ssl procs
- 63-bit time_t support in TS deltas
- const char * vs char * cleanup
- struct alignment (void *) casts
- signed vs unsigned fixes
- bad memset() call
- Bad LT_MAIN in libratbox
- char -> unsigned char casts for isdigit/isspace/etc calls

Thanks Jilles!
This commit is contained in:
Jail Bird 2015-04-20 00:55:20 -05:00
parent 32fb589528
commit 29c92cf95f
40 changed files with 97 additions and 131 deletions

View file

@ -223,7 +223,7 @@ apply_dline(struct Client *source_p, const char *dlhost, int tdline_time, char *
int t = AF_INET, ty, b;
const char *creason;
ty = parse_netmask(dlhost, (struct sockaddr *) &daddr, &b);
ty = parse_netmask(dlhost, &daddr, &b);
if(ty == HM_HOST)
{
sendto_one(source_p, ":%s NOTICE %s :Invalid D-Line", me.name, source_p->name);

View file

@ -724,7 +724,7 @@ already_placed_kline(struct Client *source_p, const char *luser, const char *lho
if(aconf == NULL && ConfigFileEntry.non_redundant_klines)
{
bits = 0;
if((t = parse_netmask(lhost, (struct sockaddr *) &iphost, &bits)) != HM_HOST)
if((t = parse_netmask(lhost, &iphost, &bits)) != HM_HOST)
{
#ifdef RB_IPV6
if(t == HM_IPV6)

View file

@ -58,7 +58,7 @@ mapi_clist_av1 privs_clist[] = {
struct mode_table
{
const char *name;
int mode;
unsigned int mode;
};
/* there is no such table like this anywhere else */

View file

@ -412,7 +412,8 @@ stats_deny (struct Client *source_p)
static void
stats_exempt(struct Client *source_p)
{
char *name, *host, *pass, *user, *classname;
char *name, *host, *user, *classname;
const char *pass;
struct AddressRec *arec;
struct ConfItem *aconf;
int i, port;
@ -523,7 +524,8 @@ stats_auth (struct Client *source_p)
else if((ConfigFileEntry.stats_i_oper_only == 1) && !IsOper (source_p))
{
struct ConfItem *aconf;
char *name, *host, *pass = "*", *user, *classname;
char *name, *host, *user, *classname;
const char *pass = "*";
int port;
if(MyConnect (source_p))

View file

@ -57,7 +57,7 @@ DECLARE_MODULE_AV1(svinfo, NULL, NULL, svinfo_clist, NULL, NULL, "$Revision: 494
static int
ms_svinfo(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
signed int deltat;
signed long deltat;
time_t theirtime;
char squitreason[120];
@ -82,20 +82,20 @@ ms_svinfo(struct Client *client_p, struct Client *source_p, int parc, const char
*/
rb_set_time();
theirtime = atol(parv[4]);
deltat = abs(theirtime - rb_current_time());
deltat = labs(theirtime - rb_current_time());
if(deltat > ConfigFileEntry.ts_max_delta)
{
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"Link %s dropped, excessive TS delta"
" (my TS=%ld, their TS=%ld, delta=%d)",
" (my TS=%ld, their TS=%ld, delta=%ld)",
source_p->name,
(long) rb_current_time(), (long) theirtime, deltat);
ilog(L_SERVER,
"Link %s dropped, excessive TS delta"
" (my TS=%ld, their TS=%ld, delta=%d)",
" (my TS=%ld, their TS=%ld, delta=%ld)",
log_client_name(source_p, SHOW_IP), (long) rb_current_time(), (long) theirtime, deltat);
rb_snprintf(squitreason, sizeof squitreason, "Excessive TS delta (my TS=%ld, their TS=%ld, delta=%d)",
rb_snprintf(squitreason, sizeof squitreason, "Excessive TS delta (my TS=%ld, their TS=%ld, delta=%ld)",
(long) rb_current_time(), (long) theirtime, deltat);
disable_server_conf_autoconn(source_p->name);
exit_client(source_p, source_p, source_p, squitreason);
@ -106,7 +106,7 @@ ms_svinfo(struct Client *client_p, struct Client *source_p, int parc, const char
{
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
"Link %s notable TS delta"
" (my TS=%ld, their TS=%ld, delta=%d)",
" (my TS=%ld, their TS=%ld, delta=%ld)",
source_p->name, (long) rb_current_time(), (long) theirtime, deltat);
}

View file

@ -120,7 +120,7 @@ mo_testline(struct Client *client_p, struct Client *source_p, int parc, const ch
host = mask;
/* parses as an IP, check for a dline */
if((type = parse_netmask(host, (struct sockaddr *)&ip, &host_mask)) != HM_HOST)
if((type = parse_netmask(host, &ip, &host_mask)) != HM_HOST)
{
#ifdef RB_IPV6
if(type == HM_IPV6)

View file

@ -36,7 +36,7 @@
#include "parse.h"
#include "modules.h"
static char *confopts(struct Client *source_p);
static char *confopts(void);
static int m_version(struct Client *, struct Client *, int, const char **);
static int mo_version(struct Client *, struct Client *, int, const char **);
@ -79,7 +79,7 @@ m_version(struct Client *client_p, struct Client *source_p, int parc, const char
#ifdef CUSTOM_BRANDING
PACKAGE_NAME "-" PACKAGE_VERSION,
#endif
me.name, confopts(source_p), TS_CURRENT,
me.name, confopts(), TS_CURRENT,
ServerInfo.sid);
show_isupport(source_p);
@ -101,7 +101,7 @@ mo_version(struct Client *client_p, struct Client *source_p, int parc, const cha
#ifdef CUSTOM_BRANDING
PACKAGE_NAME "-" PACKAGE_VERSION,
#endif
me.name, confopts(source_p), TS_CURRENT,
me.name, confopts(), TS_CURRENT,
ServerInfo.sid);
show_isupport(source_p);
}
@ -110,12 +110,12 @@ mo_version(struct Client *client_p, struct Client *source_p, int parc, const cha
}
/* confopts()
* input - client pointer
* input - none
* output - ircd.conf option string
* side effects - none
*/
static char *
confopts(struct Client *source_p)
confopts(void)
{
static char result[15];
char *p;