1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-09 10:53:13 +02:00

Added './unreal upgrade-conf': this will upgrade your 3.2.x configuration files to 3.4.x syntax.

Original file is (of course) backed up as .conf.old.
Currently handled changes in this upgrade: loadmodule, me, link, throttle, spamfilter, allow, vhost, oper.
I think those are all right now. Please report any failures / strange issues on bugs.unrealircd.org
This commit is contained in:
Bram Matthys
2015-06-07 19:34:21 +02:00
parent 1dec4c5a98
commit bd1747f5c4
8 changed files with 991 additions and 803 deletions
+1
View File
@@ -762,3 +762,4 @@ extern int mixed_network(void);
extern void unreal_delete_masks(ConfigItem_mask *m);
extern void unreal_add_masks(ConfigItem_mask **head, ConfigEntry *ce);
extern int unreal_mask_match(aClient *acptr, ConfigItem_mask *m);
extern char *our_strcasestr(char *haystack, char *needle);
+4 -1
View File
@@ -29,7 +29,7 @@ OBJS=timesynch.o res.o s_bsd.o auth.o aln.o channel.o cloak.o crule.o dbuf.o \
ssl.o s_user.o charsys.o scache.o send.o support.o umodes.o \
version.o whowas.o cidr.o random.o extcmodes.o moddata.o uid.o \
extbans.o api-isupport.o api-command.o md5.o crypt_blowfish.o \
$(URL)
updconf.o $(URL)
SRC=$(OBJS:%.o=%.c)
@@ -257,6 +257,9 @@ api-isupport.o: api-isupport.c $(INCLUDES)
crypt_blowfish.o: crypt_blowfish.c $(INCLUDES)
$(CC) $(CFLAGS) -c crypt_blowfish.c
updconf.o: updconf.c $(INCLUDES)
$(CC) $(CFLAGS) -c updconf.c
url.o: url.c $(INCLUDES)
$(CC) $(CFLAGS) -c url.c
+4 -1
View File
@@ -1166,6 +1166,7 @@ int InitwIRCD(int argc, char *argv[])
mp_pool_init();
dbuf_init();
initlists();
#ifdef USE_LIBCURL
url_init();
@@ -1339,6 +1340,9 @@ int InitwIRCD(int argc, char *argv[])
generate_cloakkeys();
exit(0);
#endif
case 'U':
update_conf();
exit(0);
default:
#ifndef _WIN32
return bad_command(myargv[0]);
@@ -1412,7 +1416,6 @@ int InitwIRCD(int argc, char *argv[])
clear_watch_hash_table();
bzero(&loop, sizeof(loop));
init_CommandHash();
initlists();
initwhowas();
initstats();
DeleteTempModules();
-19
View File
@@ -338,25 +338,6 @@ static ConfigItem_badword *copy_badword_struct(ConfigItem_badword *ca, int regex
return x;
}
/*
* our own strcasestr implementation because strcasestr is often not
* available or is not working correctly.
*/
char *our_strcasestr(char *haystack, char *needle) {
int i;
int nlength = strlen (needle);
int hlength = strlen (haystack);
if (nlength > hlength) return NULL;
if (hlength <= 0) return NULL;
if (nlength <= 0) return haystack;
for (i = 0; i <= (hlength - nlength); i++) {
if (strncasecmp (haystack + i, needle, nlength) == 0)
return haystack + i;
}
return NULL; /* not found */
}
static inline int fast_badword_match(ConfigItem_badword *badword, char *line)
{
char *p;
-19
View File
@@ -297,25 +297,6 @@ DLLFUNC int censor_config_run(ConfigFile *cf, ConfigEntry *ce, int type)
return 1;
}
/*
* our own strcasestr implementation because strcasestr is often not
* available or is not working correctly.
*/
char *our_strcasestr(char *haystack, char *needle) {
int i;
int nlength = strlen (needle);
int hlength = strlen (haystack);
if (nlength > hlength) return NULL;
if (hlength <= 0) return NULL;
if (nlength <= 0) return haystack;
for (i = 0; i <= (hlength - nlength); i++) {
if (strncasecmp (haystack + i, needle, nlength) == 0)
return haystack + i;
}
return NULL; /* not found */
}
static inline int fast_badword_match(ConfigItem_badword *badword, char *line)
{
char *p;
+19
View File
@@ -1129,3 +1129,22 @@ int unreal_mask_match(aClient *acptr, ConfigItem_mask *m)
return 0;
}
/*
* our own strcasestr implementation because strcasestr is often not
* available or is not working correctly.
*/
char *our_strcasestr(char *haystack, char *needle) {
int i;
int nlength = strlen (needle);
int hlength = strlen (haystack);
if (nlength > hlength) return NULL;
if (hlength <= 0) return NULL;
if (nlength <= 0) return haystack;
for (i = 0; i <= (hlength - nlength); i++) {
if (strncasecmp (haystack + i, needle, nlength) == 0)
return haystack + i;
}
return NULL; /* not found */
}
+960 -762
View File
File diff suppressed because it is too large Load Diff
+3 -1
View File
@@ -54,6 +54,8 @@ elif [ "$1" = "version" ] ; then
@BINDIR@ -v
elif [ "$1" = "gencloak" ] ; then
@BINDIR@ -k
elif [ "$1" = "upgrade-conf" ] ; then
@BINDIR@ -U
elif [ "$1" = "backtrace" ] ; then
cd @IRCDDIR@
@@ -150,5 +152,5 @@ __EOF__
echo ""
echo "Thanks!"
else
echo "Usage: unreal start|stop|rehash|restart|mkpasswd|version|gencloak"
echo "Usage: unreal start|stop|rehash|restart|mkpasswd|version|gencloak|upgrade-conf"
fi