Compare commits

..

2 Commits

Author SHA1 Message Date
Sam Dodrill 3d74da6cbc Add HTTP parser from https://github.com/joyent/http-parser 2013-11-24 13:45:53 -08:00
Sam Dodrill 1553d3c136 Add first parts of websocket support
This commit adapted from:
    2703ca0b42
2013-11-24 13:41:39 -08:00
299 changed files with 52101 additions and 48667 deletions

View File

@ -1,2 +0,0 @@
au BufWritePost *.c execute 'silent !astyle --style=linux --mode=c -n' shellescape(expand('%'), 1) ' >/dev/null'
au BufWritePost *.h execute 'silent !astyle --style=linux --mode=c -n' shellescape(expand('%'), 1) ' >/dev/null'

View File

@ -1,12 +0,0 @@
language: c
compiler:
- gcc
before-install:
- sudo apt-get update
install:
- sudo apt-get install build-essential libssl-dev flex bison
script: "./configure && make"
notifications:
irc: "irc.yolo-swag.com#elemental-ircd"

View File

@ -1,20 +0,0 @@
# Contribution guidelines
Please open contributions as either issue reports or pull requests. We will ask
that anything that requires testing outside our normally supported platforms be
marked as such.
As ircd is such an ancient project with varying code styles, please try to
follow the current coding style of the file you are in. If all else fails,
please use the [Linux Kernel](https://www.kernel.org/doc/Documentation/CodingStyle)
coding style.
Please run all code against the following `astyle` command before sending in
a pull request:
```console
$ astyle --style=linux --mode=c -n $file
```
It should be trivial to set up your text editor to do this for you.

15
CREDITS
View File

@ -1,23 +1,14 @@
$Id: CREDITS 3133 2007-01-21 15:38:16Z jilles $
Elemental-IRCd is a fork of the now-defunct ShadowIRCD project.
The Elemental-IRCd team is listed below in nick-alphabetical order:
Xena, Sam Dodrill <shadowh511 -at- gmail.com>
Some Elemental-IRCd features are modeled after or direct ports of
code from Charybdis.
ponychat-ircd is a fork of the ShadowIRCD project created to meet
elemental-ircd is a fork of the ShadowIRCD project created to meet
PonyChat's needs and keep the now-defunct ShadowIRCD project's goals
alive.
The ponychat-ircd team is listed in nick-alphabetical order:
The elemental-ircd team is listed in nick-alphabetical order:
aji, Alex Iadicico <alex -at- ajitek.net>
lyska, Sam Dodrill <shadowh511 -at- gmail.com>>
Kabaka, Kyle Johnson <kabaka -at- ponychat.net>
Xe, Sam Dodrill <shadowh511 -at- gmail.com>
ShadowIRCd 6 is a modern restart of the old ShadowIRCd project
based on Charybdis with a few additional features to make it appeal

99
Config
View File

@ -1,99 +0,0 @@
#!/usr/bin/env python
"""
Copyright 2014 Sam Dodrill <shadowh511@gmail.com>
This software is under GPL.
"""
from os import system
try:
raw_input = raw_input
except NameError:
raw_input = input
art = """
_______ __ __ __ _______ ______ ______ __
| ___| |.-----.--------.-----.-----.| |_.---.-.| |_____|_ _| __ \ |.--| |
| ___| || -__| | -__| || _| _ || |______|| |_| < ---|| _ |
|_______|__||_____|__|__|__|_____|__|__||____|___._||__| |_______|___|__|______||_____|"""
welcome ="""
Welcome to the Elemental-IRCd Configuration script. This script will help you choose the
best compile flags for your installation of Elemental-IRCd.
"""
class Configure():
def promptUser(self, prompt, default):
inp = raw_input("%s [%s]> " % (prompt, default))
if inp == "":
return default
return inp
def promptYesNo(self, prompt, defult=True):
inp = False if self.promptUser(prompt, "Y") == "N" else True
return inp
def go(self):
configflags = ["./configure"]
print(art)
print(welcome)
print("Please specify where you would like to install Elemental-IRCd.")
installloc = self.promptUser("Install location?", "$HOME/ircd")
print("")
print("Please specify the maximum nickname length. This must be the same across")
print("all servers in your network or you risk desyncs. The maximum is 50.")
nicklen = 0
nicklen_valid = False
while not nicklen_valid:
try:
nicklen = int(self.promptUser("Maximum nickname length?", "31"))
if nicklen < 51:
nicklen_valid = True
except ValueError:
nicklen_valid = False
if not nicklen_valid:
print("Error: you must choose an integer value under 50.")
print("")
print("Would you like to disable small network support? This increases the size")
print("of a few buffers in the code and can increase performance on large networks.")
smallnet = self.promptYesNo("Small network? (Y/N)")
configflags.append("--prefix=%s" % installloc)
configflags.append("--with-nicklen=%s" % nicklen)
if not smallnet:
configflags.append("--enable-small-net")
else:
configflags.append("--disable-small-net")
print("\nThat should be it for now. Running %s" % " ".join(configflags))
raw_input("Press enter to continue... ")
system(" ".join(configflags))
print(art)
print("""
Next, run `make` and `make install`. Then copy %s/etc/example.conf to
%s/etc/ircd.conf and read through the example configuration completely to make
sure your install is tailored to your needs. After that, run %s/bin/ircd
and start to connect clients and servers as you need.
If you have any problems, please check the documentation in the doc/ folder
of the source repository. If problems persist please stop by #elemental-ircd
on irc.yolo-swag.com and ask. Running Elemental-IRCd in insane conditions may
make support either very difficult or at most impossible.""" % (installloc, installloc, installloc))
system("clear")
c = Configure()
try:
c.go()
except (KeyboardInterrupt, EOFError):
print("\nInterrupted, exiting!")
# vim: set ts=4 sw=4 tw=0 et

View File

@ -1,22 +0,0 @@
FROM flitter/init
MAINTAINER Xena <xena@yolo-swag.com>
# Update base system
RUN apt-get update && apt-get upgrade -yq && \
apt-get -yq install build-essential autoconf libssl-dev flex bison && \
adduser --system --home /home/ircd ircd && \
mkdir /home/ircd/src && \
chmod 777 /home/ircd/src
ADD . /home/ircd/src
RUN cd /home/ircd/src; ./configure --prefix=/home/ircd/run ; make ; make install
ADD doc/example.conf /home/ircd/run/etc/ircd.conf
ADD extra/runit/ /etc/service/ircd/
RUN chmod -R 777 /home/ircd/run
EXPOSE 6667
ENTRYPOINT /sbin/my_init

37
FAQ Normal file
View File

@ -0,0 +1,37 @@
ShadowIRCd FAQ
--------------
Q: Why does ShadowIRCd not have remote includes?
A: Remote Includes are a possible security risk due to possible MITM attacks
and such and do not prevent server owners making changes that you do not
want them to so they have little point. It is recommended to use rsync or
a git/hg cron job to pull in remote configuration files.
Q: Does ShadowIRCd support Windows?
A: No. There is no point in running IRCd on windows, aside perhaps as a quick
testnet. If you feel like doing it anyway, the best thing to try would be
some form of VM. We've heard that it doesn't compile on cygwin. We also
have no interest in supporting windows in the future. If you're looking
to start up an IRC network, you should really look into buying a VPS or
shell from a decent provider.
Q: I want shun, m_invisible, unreal-style m_spy, saquit, etc!
A: ShadowIRCd does not intend to ever implement such features. They have
little to no legitimate use, amazing abuse potential, and are inferior to
other methods. If for some reason you cannot live without such features,
you should probably use another ircd.
Q: What services should I run with ShadowIRCd?
A: The ShadowIRCd team highly recommends Atheme IRC Services (www.atheme.net),
which is known to support ShadowIRCd properly and is a great services
package overall. ShadowIRCd may work with Anope 1.8.x using the charybdis
protocol module and 1.9.x using the ratbox protocol module, but it is not
recommended and it has not been tested by the ShadowIRCd developers.
Q: I've got two servers linked and users on one are getting constant flood notices
when trying to send to channels. HELP!!!!
A: Has your server's clock gone backwards massively recently? (probably due to it
being incorrect). If so, you have two options. You can either wait for the real
time to be what the incorrect time was, or you can restart the affected server.
If that does not fix the problem, please file a bug at:
http://jira.atheme.org/browse/SHAD

6
GIT-Access Normal file
View File

@ -0,0 +1,6 @@
The ShadowIRCd Stable GIT repository can be checked out using the following command:
git clone git://git.atheme.org/unofficial/shadowircd-stable.git shadowircd-stable
ShadowIRCd's GIT repository depot can be browsed over the internet at
the following address:
http://git.atheme.org/unofficial/shadowircd-stable/

56
NEWS
View File

@ -1,60 +1,6 @@
This is elemental-ircd 6.6.1, Copyright (c) 2014 elemental-ircd team.
This is elemental-ircd 6.5, Copyright (c) 2013 elemental-ircd team.
See LICENSE for licensing details (GPL v2).
-- elemental-ircd 6.6.1
All code is now in the linux kernel coding style. Patches that do not
follow this coding style are at risk of being rejected. It is suggested
that your editor be set up to automatically style your code in the
desired format. A vim resource file is provided in the repository root.
additions
- automatic code styling for vim
- Dockerfile and nightly docker builds
- show cloaked I:Line vhost IP address remotely
bugfixes
- all channel lists have their own limit instead of sharing one.
5ba9c76d224afac877d9500d6ac1eb8f2bddd076
- fix potential undefined behavior with m_away
7d3966bc9bd9e9ab7833b4ecb0751671bdd085e7
- fix Anope 2.0 protocol module
79a3bf79ae66c43470c4bed25c33053b13a032d1
-- elemental-ircd 6.6
additions
- add OWNER=y to 005
- add autoconfigure script like unrealircd
- add channel mode +u to hide banlists unless users have halfop or up
- add modules for services packages
- add quotes around PART reason
- add umode +I to hide channels line from WHOIS
- make end-user /OPER failures much more generic
- make flooding SNOTEs global
- show own modes in whois
- show remote server IP addresses
- update helpfiles to have much more up to date information
bugfixes
- don't strip unicode in strip_unprintable
- fix extended-join for remote users
- fix null reference in away-notify
- make genssl.sh generate ten year certs
- merge some upstream charybdis patches
removals
- remove away-notify
- remove AHBL from default configs
- remove m_post SNOTEs because of an upstream change
The official channel for Elemental-IRCd is now #elemental-ircd on
irc.yolo-swag.com.
-- elemental-ircd 6.5.1
Rename to Elemental-IRCd
-- ponychat-ircd 6.5
additions

100
README.FIRST Normal file
View File

@ -0,0 +1,100 @@
If you don't read this first, we won't help you.
:-)
******************************* IMPORTANT *************************************
*********** Note for those who dont bother reading docs *****************
* - Reading INSTALL is now a must, as the old DPATH is now specified *
* when configure is run. *
* You now need to ./configure --prefix="/path/to/install/it" *
* will be installed with your ircd! *
*************************************************************************
ALSO, IF YOU ARE UPGRADING YOUR CURRENT SOURCE TREE, AND YOU TRY TO BUILD
IN IT WITHOUT PERFORMING AT LEAST 'make clean', THINGS _WILL_ BREAK. IT IS
RECOMMENDED THAT YOU RUN 'make distclean' AND THEN RERUN './configure'!
******************************* REQUIREMENTS **********************************
New Features - A short introduction:
- Please see NEWS for more detailed changes.
Necessary Requirements:
- A supported platform (look below)
- A working dynamic load library, unless
compiling as static, without module
support.
- A working lex. Solaris /usr/ccs/bin/lex
appears to be broken, on this system flex
should be used.
- A working parser/generator. bison is
recommended on most platforms.
Feature Specific Requirements:
- For SSL Clients, SSL Challenge controlled OPER feature, and encrypted server links,
a working OpenSSL library
- For encrypted oper and (optional) server passwords, a working DES, MD5, or SHA library.
*******************************************************************************
- To report bugs in ShadowIRCd, visit us at irc.thinstack.net #shadowircd
- See the INSTALL document for info on configuring and compiling
ShadowIRCd.
- Please read doc/index.txt to get an overview of the current documentation.
- The files, /etc/services, /etc/protocols, and /etc/resolv.conf, MUST be
readable by the user running the server in order for ircd to start.
Errors from adns causing the ircd to refuse to start up are often related
to permission problems on these files.
- FREEBSD USERS: if you are compiling with ipv6 you may experience
problems with ipv4 due to the way the socket code is written. To
fix this you must: "sysctl net.inet6.ip6.v6only=0"
- SOLARIS USERS: this code appears to tickle a bug in older gcc and
egcs ONLY on 64-bit Solaris7. gcc-2.95 and SunPro C on 64bit should
work fine, and any gcc or SunPro compiled on 32bit.
- DARWIN AND MACOS X USERS: You must be using at least the December 2001
Development Tools from Apple to build charybdis with shared modules.
Before then you MUST disable shared modules, as we do not have the proper
flags for cc(1) prior to that point to produce shared modules.
- SUPPORTED PLATFORMS: this code should compile without any warnings on:
FreeBSD 6.x/7.x/8.x,
Gentoo & Gentoo Hardened ~x86/~amd64/~fbsd
Fedora 8/9 / CentOS 4/5 / Redhat Enterprise 5
Debian Etch/Lenny/Squeeze,
OpenSuSE 10/11,
ArchLinux,
OpenSolaris 2008.x?
Solaris 10 sparc.
Please let us know if you find otherwise.
It probably does not compile on AIX, IRIX or libc5 Linux.
- TESTED PLATFORMS: The code has been tested on the following platforms, and
is known to run properly.
FreeBSD 6.x/7.x/8.x
Linux glibc-2.6, glibc-2.7, glibc-2.8, glibc-2.10, glibc-2.11
Solaris 2.6/7/8
OpenBSD 2.8
NetBSD 1.4
OpenVMS/Alpha 7.2 (static modules, no ssld)
- Please read NEWS for information about what is in this release
- Other files recommended for reading: INSTALL
--------------------------------------------------------------------------------
$Id$

View File

@ -1,35 +1,18 @@
# Elemental-IRCd
# elemental-ircd
**Elemental-IRCd** is a high performance, lightweight, and scalable
IRC daemon. It is a fork of the now-defunct ShadowIRCD and seeks to continue in
the direction ShadowIRCD was headed.
**elemental-ircd** is a high performance, lightweight, and scalable
IRC daemon. It is a fork of the now-defunct ShadowIRCD created to meet
PonyChat's needs, and seeks to continue in the direction ShadowIRCD
was headed.
## Supported Platforms
All modern \*NIX systems should work. You need the equivalent of the following
Debian packages:
- `libssl-dev`
- `flex`
- `bison`
- `build-essential`
```
Cassy | If you put something on a platform which cannot support it
| it may tip and fall and become broken. Simple physics.
```
Read the included documentation for detailed compilation and install
directions.
<Cassy> If you put something on a platform which cannot support it
it may tip and fall and become broken. Simple physics.
## Support
The official channel for Elemental-IRCd is `#elemental-ircd` on
`irc.yolo-swag.com`. Anyone with push access to the repository will have halfop
(`+h`, `%`) or higher.
Atheme and Anope (1.8 and 2.0) modules are included in the source tree of
Elemental-IRCd. For most cases the default `protocol/elemental-ircd` module in
Atheme should be fine, but this version will always be more up-to-date.
Our support channel is `#rainbow-factory` on `irc.ponychat.net`. Poke
**aji**, **lyska**, or **Kabaka** for help.
To report bugs, please use the GitHub issue tracker.

61
TODO Normal file
View File

@ -0,0 +1,61 @@
/ = in progress, x = done, ? = to be discussed, F = charybdis3.1 or next releases
[/] finish legacy code removal
[x] remove 2.8 report_error() in ratbox imported stuff
[F] client.c, channel.c is very 2.8 style still. it'd be nice to pack them into their own
namespace and such. moreover, the other 2.8 code needs similar rewriting/reworking too...
[x] merge m_join.c and m_sjoin.c in one module (same functions, done in ratbox3)
[ ] rewrite s_auth.c
[ ] authentication state/lock manager
[ ] move resolver/auth checker code into separated modules
[x] port to libratbox
[x] get it running
[x] clean up maxconnections kludges &c
[x] in-process SSL
[x] port and use ratbox ssld for server links
[x] merge with libratbox SVN
[x] ssl stuff
[x] client-to-client ssl
[x] server-to-server ssl
[x] ssl usermode (+Z)
[x] ssl channelmode (done by extban and chm_compat)
[x] tool for generating ssl certificates and other stuff
[x] gnutls backend for at least SSL connections (replacing libcrypto use in m_challenge would be nice too)
[x] merge some stuff from ircd-seven directly (to be determined what)
[x] remote d:lines support
[x] PASS selector:password for auth{} (useful for dynamic IPs)
[ ] kline/xline/resv sync (what about spb's extension?)
[x] drop non-TS6 (legacy protocol) support
[?] Patch or core-feature - libguess on-fly any-charset-to-utf8 translation
[x] module engine rework
[?] MODULE_DEPEND and MODULE_CONFLICT for building extension dependencies (backport from shadowircd)
[x] more beautiful way of adding new channel modes by module
[x] basic functionality
[x] some example modules
[x] another idea is too make that work with privilege groups, like "serveradmins" or "ircops"
[ ] make nick/user/host validation functions/match tables able to work in separated modules,
this will help us making support for native characters sets/slashes in host etc
[ ] auth checker module
[ ] resolver module
[x] privilege system for privilege groups, something like
in .conf: helper { kill_global, rehash, kline_local }
in modules: privilege_add("kill_global"), has_privilege(source_p, "kill_global") etc, should work the way dynamic cflags/umodes done
-- this is done kinda like this, but not really. See HasPrivilege() calls. privilege_add() was not needed ~nenolod
[x] Remove glines entirely
[/] test suite as in ircu
[?] win32
[?] mingw support
[R] win32 native support - VS doesn't follow C99, this will require us switching back to C89 with libratbox and (future) core
[x] Bug fixes
[x] Compilation without zlib headers fails - fixed
[x] Compilation date and time in server welcome message is in OS locale - looks ugly 'cause often it's not match user's codepage
[ ] Improvments
[ ] ircd shouldn't need bison/byacc/yacc or flex for compilation
--- other stuff
[?] internally split out +o/+v "ranks" into a series of permissions. this could allow for configure-defined
special access levels, halfops, etc. (would need to match globally, somehow. extra SVINFO param?)
might be backported from shadowircd in future (chanroles planned)
[?] somehow hide channel operators like ircnet can do?
couldn't be done via extension currently - compilation-time option acceptable?
[x] create chmode.h and put there all declarations of chm_* - this will make some modules clean
[?] Move oper override server WALLOPS to global server notices?

5
TODO-SHADOW Normal file
View File

@ -0,0 +1,5 @@
TODO list for ShadowIRCd 7.0
----------------------------
* evaluate some of the more inane cmodes (D, E, N, etc) for possible removal.
* move umode +B to extensions
* evaluate old code and clean up / improve where improvement can be made

View File

@ -1,23 +0,0 @@
# TODO
## elemental-ircd 6.7
- [ ] Finish websocket support
- [x] Configuration for websocket ports
- [x] HTTP parsing of websocket data
- [ ] Client connections via websockets
- [x] Send cloaked host as METADATA
- [x] Fix a flaw in the kick permission logic
- [x] Fix segfault on `autojoin_opers`
- [x] Update many of the helpfiles with the proper permissions
- [ ] extban by certfp
### Services Modules
- [ ] Support METADATA for the cloaked host
- [ ] Anope 2.0
- [ ] Atheme
- [ ] Have /hs off re-set the cloaked host instead of the user's real hostmask
- [ ] Anope 2.0
- [ ] Atheme

View File

@ -40,7 +40,8 @@
#define COMMIT_INTERVAL 3 /* seconds */
typedef enum {
typedef enum
{
BANDB_KLINE,
BANDB_DLINE,
BANDB_XLINE,
@ -80,10 +81,12 @@ parse_ban(bandb_type type, char *parv[], int parc)
const char *perm = NULL;
int para = 1;
if(type == BANDB_KLINE) {
if(type == BANDB_KLINE)
{
if(parc != 7)
return;
} else if(parc != 6)
}
else if(parc != 6)
return;
mask1 = parv[para++];
@ -96,7 +99,8 @@ parse_ban(bandb_type type, char *parv[], int parc)
perm = parv[para++];
reason = parv[para++];
if(!in_transaction) {
if(!in_transaction)
{
rsdb_transaction(RSDB_TRANS_START);
in_transaction = 1;
rb_event_addonce("bandb_commit", bandb_commit, NULL,
@ -114,10 +118,12 @@ parse_unban(bandb_type type, char *parv[], int parc)
const char *mask1 = NULL;
const char *mask2 = NULL;
if(type == BANDB_KLINE) {
if(type == BANDB_KLINE)
{
if(parc != 3)
return;
} else if(parc != 2)
}
else if(parc != 2)
return;
mask1 = parv[1];
@ -125,7 +131,8 @@ parse_unban(bandb_type type, char *parv[], int parc)
if(type == BANDB_KLINE)
mask2 = parv[2];
if(!in_transaction) {
if(!in_transaction)
{
rsdb_transaction(RSDB_TRANS_START);
in_transaction = 1;
rb_event_addonce("bandb_commit", bandb_commit, NULL,
@ -146,17 +153,19 @@ list_bans(void)
/* schedule a clear of anything already pending */
rb_helper_write_queue(bandb_helper, "C");
for(i = 0; i < LAST_BANDB_TYPE; i++) {
for(i = 0; i < LAST_BANDB_TYPE; i++)
{
rsdb_exec_fetch(&table, "SELECT mask1,mask2,oper,reason FROM %s WHERE 1",
bandb_table[i]);
for(j = 0; j < table.row_count; j++) {
for(j = 0; j < table.row_count; j++)
{
if(i == BANDB_KLINE)
snprintf(buf, sizeof(buf), "%c %s %s %s :%s",
rb_snprintf(buf, sizeof(buf), "%c %s %s %s :%s",
bandb_letter[i], table.row[j][0],
table.row[j][1], table.row[j][2], table.row[j][3]);
else
snprintf(buf, sizeof(buf), "%c %s %s :%s",
rb_snprintf(buf, sizeof(buf), "%c %s %s :%s",
bandb_letter[i], table.row[j][0],
table.row[j][2], table.row[j][3]);
@ -178,13 +187,15 @@ parse_request(rb_helper *helper)
int len;
while((len = rb_helper_read(helper, readbuf, sizeof(readbuf))) > 0) {
while((len = rb_helper_read(helper, readbuf, sizeof(readbuf))) > 0)
{
parc = rb_string_to_array(readbuf, parv, MAXPARA);
if(parc < 1)
continue;
switch (parv[0][0]) {
switch (parv[0][0])
{
case 'K':
parse_ban(BANDB_KLINE, parv, parc);
break;
@ -277,7 +288,7 @@ static void
db_error_cb(const char *errstr)
{
char buf[256];
snprintf(buf, sizeof(buf), "! :%s", errstr);
rb_snprintf(buf, sizeof(buf), "! :%s", errstr);
rb_helper_write(bandb_helper, buf);
rb_sleep(2 << 30, 0);
exit(1);
@ -288,7 +299,8 @@ main(int argc, char *argv[])
{
setup_signals();
bandb_helper = rb_helper_child(parse_request, error_cb, NULL, NULL, NULL, 256, 256, 256, 256); /* XXX fix me */
if(bandb_helper == NULL) {
if(bandb_helper == NULL)
{
fprintf(stderr,
"This is ircd-ratbox bandb. You aren't supposed to run me directly. Maybe you want bantool?\n");
fprintf(stderr,
@ -309,7 +321,8 @@ check_schema(void)
struct rsdb_table table;
int i;
for(i = 0; i < LAST_BANDB_TYPE; i++) {
for(i = 0; i < LAST_BANDB_TYPE; i++)
{
rsdb_exec_fetch(&table,
"SELECT name FROM sqlite_master WHERE type='table' AND name='%s'",
bandb_table[i]);

View File

@ -51,7 +51,8 @@
#define BT_VERSION "0.4.1"
typedef enum {
typedef enum
{
BANDB_KLINE,
BANDB_KLINE_PERM,
BANDB_DLINE,
@ -83,7 +84,8 @@ static char me[PATH_MAX];
/* *INDENT-OFF* */
/* report counters */
struct counter {
struct counter
{
unsigned int klines;
unsigned int dlines;
unsigned int xlines;
@ -92,7 +94,8 @@ struct counter {
} count = {0, 0, 0, 0, 0};
/* flags set by command line options */
struct flags {
struct flags
{
int none;
int export;
int import;
@ -137,8 +140,10 @@ main(int argc, char *argv[])
rb_strlcpy(me, argv[0], sizeof(me));
while((opt = getopt(argc, argv, "hieuspvwd")) != -1) {
switch (opt) {
while((opt = getopt(argc, argv, "hieuspvwd")) != -1)
{
switch (opt)
{
case 'h':
print_help(EXIT_SUCCESS);
break;
@ -180,7 +185,8 @@ main(int argc, char *argv[])
print_help(EXIT_FAILURE);
if((flag.import && flag.export) || (flag.export && flag.wipe)
|| (flag.verify && flag.pretend) || (flag.export && flag.pretend)) {
|| (flag.verify && flag.pretend) || (flag.export && flag.pretend))
{
fprintf(stderr, "* Error: Conflicting flags.\n");
if(flag.export && flag.pretend)
fprintf(stderr, "* There is nothing to 'pretend' when exporting.\n");
@ -198,8 +204,10 @@ main(int argc, char *argv[])
"* ircd-ratbox bantool v.%s ($Id: bantool.c 26164 2008-10-26 19:52:43Z androsyn $)\n",
BT_VERSION);
if(flag.pretend == NO) {
if(rsdb_init(db_error_cb) == -1) {
if(flag.pretend == NO)
{
if(rsdb_init(db_error_cb) == -1)
{
fprintf(stderr, "* Error: Unable to open database\n");
exit(EXIT_FAILURE);
}
@ -208,7 +216,8 @@ main(int argc, char *argv[])
if(flag.vacuum)
db_reclaim_slack();
if(flag.import && flag.wipe) {
if(flag.import && flag.wipe)
{
flag.dupes_ok = YES; /* dont check for dupes if we are wiping the db clean */
for(i = 0; i < 3; i++)
fprintf(stdout,
@ -225,8 +234,9 @@ main(int argc, char *argv[])
fprintf(stdout, "* Allowing duplicate bans...\n");
/* checking for our files to import or export */
for(i = 0; i < LAST_BANDB_TYPE; i++) {
snprintf(conf, sizeof(conf), "%s/%s.conf%s",
for(i = 0; i < LAST_BANDB_TYPE; i++)
{
rb_snprintf(conf, sizeof(conf), "%s/%s.conf%s",
etc, bandb_table[i], bandb_suffix[i]);
if(flag.import && flag.pretend == NO)
@ -242,7 +252,8 @@ main(int argc, char *argv[])
rsdb_transaction(RSDB_TRANS_END);
}
if(flag.import) {
if(flag.import)
{
if(count.error && flag.verbose)
fprintf(stderr, "* I was unable to locate %i config files to import.\n",
count.error);
@ -286,16 +297,17 @@ export_config(const char *conf, int id)
return;
if(strstr(conf, ".perm") != 0)
snprintf(sql, sizeof(sql),
rb_snprintf(sql, sizeof(sql),
"SELECT DISTINCT mask1,mask2,reason,oper,time FROM %s WHERE perm = 1 ORDER BY time",
bandb_table[id]);
else
snprintf(sql, sizeof(sql),
rb_snprintf(sql, sizeof(sql),
"SELECT DISTINCT mask1,mask2,reason,oper,time FROM %s WHERE perm = 0 ORDER BY time",
bandb_table[id]);
rsdb_exec_fetch(&table, sql);
if(table.row_count <= 0) {
if(table.row_count <= 0)
{
rsdb_exec_fetch_end(&table);
return;
}
@ -304,18 +316,21 @@ export_config(const char *conf, int id)
fprintf(stdout, "* checking for %s: ", conf); /* debug */
/* open config for reading, or skip to the next */
if(!(fd = fopen(conf, "w"))) {
if(!(fd = fopen(conf, "w")))
{
if(flag.verbose)
fprintf(stdout, "\tmissing.\n");
count.error++;
return;
}
for(j = 0; j < table.row_count; j++) {
switch (id) {
for(j = 0; j < table.row_count; j++)
{
switch (id)
{
case BANDB_DLINE:
case BANDB_DLINE_PERM:
snprintf(buf, sizeof(buf),
rb_snprintf(buf, sizeof(buf),
"\"%s\",\"%s\",\"\",\"%s\",\"%s\",%s\n",
table.row[j][mask1],
mangle_reason(table.row[j][reason]),
@ -325,7 +340,7 @@ export_config(const char *conf, int id)
case BANDB_XLINE:
case BANDB_XLINE_PERM:
snprintf(buf, sizeof(buf),
rb_snprintf(buf, sizeof(buf),
"\"%s\",\"0\",\"%s\",\"%s\",%s\n",
escape_quotes(table.row[j][mask1]),
mangle_reason(table.row[j][reason]),
@ -334,7 +349,7 @@ export_config(const char *conf, int id)
case BANDB_RESV:
case BANDB_RESV_PERM:
snprintf(buf, sizeof(buf),
rb_snprintf(buf, sizeof(buf),
"\"%s\",\"%s\",\"%s\",%s\n",
table.row[j][mask1],
mangle_reason(table.row[j][reason]),
@ -343,7 +358,7 @@ export_config(const char *conf, int id)
default: /* Klines */
snprintf(buf, sizeof(buf),
rb_snprintf(buf, sizeof(buf),
"\"%s\",\"%s\",\"%s\",\"\",\"%s\",\"%s\",%s\n",
table.row[j][mask1], table.row[j][mask2],
mangle_reason(table.row[j][reason]),
@ -386,7 +401,8 @@ import_config(const char *conf, int id)
fprintf(stdout, "* checking for %s: ", conf); /* debug */
/* open config for reading, or skip to the next */
if(!(fd = fopen(conf, "r"))) {
if(!(fd = fopen(conf, "r")))
{
if(flag.verbose)
fprintf(stdout, "%*s", strlen(bandb_suffix[id]) > 0 ? 10 : 15,
"missing.\n");
@ -405,7 +421,8 @@ import_config(const char *conf, int id)
* dline
* "194.158.192.0/19","laptop scammers","","2005/3/17 05.33","stevoo!stevoo@efnet.port80.se{stevoo}",1111033988
*/
while(fgets(line, sizeof(line), fd)) {
while(fgets(line, sizeof(line), fd))
{
if((p = strpbrk(line, "\r\n")) != NULL)
*p = '\0';
@ -419,7 +436,8 @@ import_config(const char *conf, int id)
continue;
/* mask2 */
switch (id) {
switch (id)
{
case BANDB_XLINE:
case BANDB_XLINE_PERM:
f_mask1 = escape_quotes(clean_gecos_field(f_mask1));
@ -445,7 +463,8 @@ import_config(const char *conf, int id)
continue;
/* oper comment */
switch (id) {
switch (id)
{
case BANDB_KLINE:
case BANDB_KLINE_PERM:
case BANDB_DLINE:
@ -464,8 +483,10 @@ import_config(const char *conf, int id)
f_oper = "unknown";
/* meh */
if(id == BANDB_KLINE || id == BANDB_KLINE_PERM) {
if(strstr(f_mask1, "!") != NULL) {
if(id == BANDB_KLINE || id == BANDB_KLINE_PERM)
{
if(strstr(f_mask1, "!") != NULL)
{
fprintf(stderr,
"* SKIPPING INVALID KLINE %s@%s set by %s\n",
f_mask1, f_mask2, f_oper);
@ -476,11 +497,12 @@ import_config(const char *conf, int id)
/* append operreason_field to reason_field */
if(!EmptyString(f_oreason))
snprintf(newreason, sizeof(newreason), "%s | %s", f_reason, f_oreason);
rb_snprintf(newreason, sizeof(newreason), "%s | %s", f_reason, f_oreason);
else
snprintf(newreason, sizeof(newreason), "%s", f_reason);
rb_snprintf(newreason, sizeof(newreason), "%s", f_reason);
if(flag.pretend == NO) {
if(flag.pretend == NO)
{
if(flag.dupes_ok == NO)
drop_dupes(f_mask1, f_mask2, bandb_table[id]);
@ -499,7 +521,8 @@ import_config(const char *conf, int id)
i++;
}
switch (bandb_letter[id]) {
switch (bandb_letter[id])
{
case 'K':
count.klines += i;
break;
@ -551,20 +574,27 @@ getfield(char *newline)
end = strchr(line, ',');
while(1) {
while(1)
{
/* no trailing , - last field */
if(end == NULL) {
if(end == NULL)
{
end = line + strlen(line);
line = NULL;
if(*end == '"') {
if(*end == '"')
{
*end = '\0';
return field;
} else
}
else
return NULL;
} else {
}
else
{
/* look for a ", to mark the end of a field.. */
if(*(end - 1) == '"') {
if(*(end - 1) == '"')
{
line = end + 1;
end--;
*end = '\0';
@ -592,8 +622,10 @@ strip_quotes(const char *string)
if(string == NULL)
return NULL;
while(*string) {
if(*string != '"') {
while(*string)
{
if(*string != '"')
{
*str++ = *string;
}
string++;
@ -614,11 +646,15 @@ escape_quotes(const char *string)
if(string == NULL)
return NULL;
while(*string) {
if(*string == '"') {
while(*string)
{
if(*string == '"')
{
*str++ = '\\';
*str++ = '"';
} else {
}
else
{
*str++ = *string;
}
string++;
@ -637,8 +673,10 @@ mangle_reason(const char *string)
if(string == NULL)
return NULL;
while(*string) {
switch (*string) {
while(*string)
{
switch (*string)
{
case '"':
*str = '\'';
break;
@ -669,11 +707,14 @@ clean_gecos_field(const char *gecos)
if(gecos == NULL)
return NULL;
while(*gecos) {
if(*gecos == ' ') {
while(*gecos)
{
if(*gecos == ' ')
{
*str++ = '\\';
*str++ = 's';
} else
}
else
*str++ = *gecos;
gecos++;
}
@ -703,8 +744,10 @@ check_schema(void)
NULL
};
for(i = 0; i < LAST_BANDB_TYPE; i++) {
if(!table_exists(bandb_table[i])) {
for(i = 0; i < LAST_BANDB_TYPE; i++)
{
if(!table_exists(bandb_table[i]))
{
rsdb_exec(NULL,
"CREATE TABLE %s (mask1 TEXT, mask2 TEXT, oper TEXT, time INTEGER, perm INTEGER, reason TEXT)",
bandb_table[i]);
@ -714,8 +757,10 @@ check_schema(void)
* i can't think of any better way to do this, other then attempt to
* force the creation of column that may, or may not already exist. --dubkat
*/
else {
for(j = 0; columns[j] != NULL; j++) {
else
{
for(j = 0; columns[j] != NULL; j++)
{
if(!strcmp(columns[j], "time") && !strcmp(columns[j], "perm"))
rb_strlcpy(type, "INTEGER", sizeof(type));
else
@ -772,7 +817,8 @@ wipe_schema(void)
{
int i;
rsdb_transaction(RSDB_TRANS_START);
for(i = 0; i < LAST_BANDB_TYPE; i++) {
for(i = 0; i < LAST_BANDB_TYPE; i++)
{
rsdb_exec(NULL, "DROP TABLE %s", bandb_table[i]);
i++; /* double increment to skip over .perm */
}
@ -811,7 +857,7 @@ bt_smalldate(const char *string)
lt = gmtime(&t);
if(lt == NULL)
return NULL;
snprintf(buf, sizeof(buf), "%d/%d/%d %02d.%02d",
rb_snprintf(buf, sizeof(buf), "%d/%d/%d %02d.%02d",
lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday, lt->tm_hour, lt->tm_min);
return buf;
}

View File

@ -6,13 +6,15 @@ typedef void rsdb_error_cb(const char *);
typedef int (*rsdb_callback) (int, const char **);
typedef enum rsdb_transtype {
typedef enum rsdb_transtype
{
RSDB_TRANS_START,
RSDB_TRANS_END
}
rsdb_transtype;
struct rsdb_table {
struct rsdb_table
{
char ***row;
int row_count;
int col_count;

View File

@ -278,8 +278,10 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
int written = 0; /* bytes written so far */
int maxbytes = bytes - 1;
while((ch = *format++) && (written < maxbytes)) {
if(ch == '%') {
while((ch = *format++) && (written < maxbytes))
{
if(ch == '%')
{
/*
* Advance past the %
*/
@ -289,10 +291,12 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
* Put the most common cases first - %s %d etc
*/
if(ch == 's') {
if(ch == 's')
{
const char *str = va_arg(args, const char *);
while((*dest = *str)) {
while((*dest = *str))
{
++dest;
++str;
@ -303,7 +307,8 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
continue;
}
if(ch == 'd') {
if(ch == 'd')
{
int num = va_arg(args, int);
int quotient;
const char *str;
@ -312,13 +317,15 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
/*
* We have to special-case "0" unfortunately
*/
if(num == 0) {
if(num == 0)
{
*dest++ = '0';
++written;
continue;
}
if(num < 0) {
if(num < 0)
{
*dest++ = '-';
if(++written >= maxbytes)
continue;
@ -326,7 +333,8 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
num = -num;
}
do {
do
{
quotient = num / TABLE_MAX;
/*
@ -361,11 +369,13 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
str = IntTable[num - (quotient * TABLE_MAX)];
while((*digitptr = *str)) {
while((*digitptr = *str))
{
++digitptr;
++str;
}
} while((num = quotient) != 0);
}
while((num = quotient) != 0);
/*
* If the last quotient was a 1 or 2 digit number, there
@ -375,7 +385,8 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
while(*(digitptr - 1) == '0')
--digitptr;
while(digitptr != TempBuffer) {
while(digitptr != TempBuffer)
{
*dest++ = *--digitptr;
if(++written >= maxbytes)
break;
@ -384,7 +395,8 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
continue;
} /* if (ch == 'd') */
if(ch == 'c') {
if(ch == 'c')
{
*dest++ = va_arg(args, int);
++written;
@ -392,19 +404,22 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
continue;
} /* if (ch == 'c') */
if(ch == 'u') {
if(ch == 'u')
{
unsigned int num = va_arg(args, unsigned int);
unsigned int quotient;
const char *str;
char *digitptr = TempBuffer;
if(num == 0) {
if(num == 0)
{
*dest++ = '0';
++written;
continue;
}
do {
do
{
quotient = num / TABLE_MAX;
/*
@ -413,16 +428,19 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
str = IntTable[num - (quotient * TABLE_MAX)];
while((*digitptr = *str)) {
while((*digitptr = *str))
{
++digitptr;
++str;
}
} while((num = quotient) != 0);
}
while((num = quotient) != 0);
while(*(digitptr - 1) == '0')
--digitptr;
while(digitptr != TempBuffer) {
while(digitptr != TempBuffer)
{
*dest++ = *--digitptr;
if(++written >= maxbytes)
break;
@ -431,7 +449,8 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
continue;
} /* if (ch == 'u') */
if(ch == 'Q') {
if(ch == 'Q')
{
const char *arg = va_arg(args, const char *);
if(arg == NULL)
@ -439,7 +458,8 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
const char *str = rsdb_quote(arg);
while((*dest = *str)) {
while((*dest = *str))
{
++dest;
++str;
@ -450,8 +470,10 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
continue;
}
if(ch == 'l') {
if(*format == 'u') {
if(ch == 'l')
{
if(*format == 'u')
{
unsigned long num = va_arg(args, unsigned long);
unsigned long quotient;
const char *str;
@ -459,13 +481,15 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
++format;
if(num == 0) {
if(num == 0)
{
*dest++ = '0';
++written;
continue;
}
do {
do
{
quotient = num / TABLE_MAX;
/*
@ -474,24 +498,29 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
str = IntTable[num - (quotient * TABLE_MAX)];
while((*digitptr = *str)) {
while((*digitptr = *str))
{
++digitptr;
++str;
}
} while((num = quotient) != 0);
}
while((num = quotient) != 0);
while(*(digitptr - 1) == '0')
--digitptr;
while(digitptr != TempBuffer) {
while(digitptr != TempBuffer)
{
*dest++ = *--digitptr;
if(++written >= maxbytes)
break;
}
continue;
} else
/* if (*format == 'u') */ if(*format == 'd') {
}
else
/* if (*format == 'u') */ if(*format == 'd')
{
long num = va_arg(args, long);
long quotient;
const char *str;
@ -499,13 +528,15 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
++format;
if(num == 0) {
if(num == 0)
{
*dest++ = '0';
++written;
continue;
}
if(num < 0) {
if(num < 0)
{
*dest++ = '-';
if(++written >= maxbytes)
continue;
@ -513,28 +544,34 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
num = -num;
}
do {
do
{
quotient = num / TABLE_MAX;
str = IntTable[num - (quotient * TABLE_MAX)];
while((*digitptr = *str)) {
while((*digitptr = *str))
{
++digitptr;
++str;
}
} while((num = quotient) != 0);
}
while((num = quotient) != 0);
while(*(digitptr - 1) == '0')
--digitptr;
while(digitptr != TempBuffer) {
while(digitptr != TempBuffer)
{
*dest++ = *--digitptr;
if(++written >= maxbytes)
break;
}
continue;
} else { /* if (*format == 'd') */
}
else /* if (*format == 'd') */
{
/* XXX error */
exit(1);
}
@ -542,7 +579,8 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
} /* if (ch == 'l') */
if(ch != '%') {
if(ch != '%')
{
/* XXX error */
exit(1);
} /* if (ch != '%') */

View File

@ -41,14 +41,16 @@ rsdb_error_cb *error_cb;
static void
mlog(const char *errstr, ...)
{
if(error_cb != NULL) {
if(error_cb != NULL)
{
char buf[256];
va_list ap;
va_start(ap, errstr);
vsnprintf(buf, sizeof(buf), errstr, ap);
rb_vsnprintf(buf, sizeof(buf), errstr, ap);
va_end(ap);
error_cb(buf);
} else
}
else
exit(1);
}
@ -68,14 +70,16 @@ rsdb_init(rsdb_error_cb * ecb)
else
rb_strlcpy(dbpath, DBPATH, sizeof(dbpath));
if(sqlite3_open(dbpath, &rb_bandb) != SQLITE_OK) {
snprintf(errbuf, sizeof(errbuf), "Unable to open sqlite database: %s",
if(sqlite3_open(dbpath, &rb_bandb) != SQLITE_OK)
{
rb_snprintf(errbuf, sizeof(errbuf), "Unable to open sqlite database: %s",
sqlite3_errmsg(rb_bandb));
mlog(errbuf);
return -1;
}
if(access(dbpath, W_OK)) {
snprintf(errbuf, sizeof(errbuf), "Unable to open sqlite database for write: %s", strerror(errno));
if(access(dbpath, W_OK))
{
rb_snprintf(errbuf, sizeof(errbuf), "Unable to open sqlite database for write: %s", strerror(errno));
mlog(errbuf);
return -1;
}
@ -99,7 +103,8 @@ rsdb_quote(const char *src)
if(strlen(src) >= (sizeof(buf) / 2))
return NULL;
while(*src) {
while(*src)
{
if(*src == '\'')
*p++ = '\'';
@ -131,14 +136,18 @@ rsdb_exec(rsdb_callback cb, const char *format, ...)
i = rs_vsnprintf(buf, sizeof(buf), format, args);
va_end(args);
if(i >= sizeof(buf)) {
if(i >= sizeof(buf))
{
mlog("fatal error: length problem with compiling sql");
}
if((i = sqlite3_exec(rb_bandb, buf, (cb ? rsdb_callback_func : NULL), (void *)((uintptr_t)cb), &errmsg))) {
switch (i) {
if((i = sqlite3_exec(rb_bandb, buf, (cb ? rsdb_callback_func : NULL), (void *)((uintptr_t)cb), &errmsg)))
{
switch (i)
{
case SQLITE_BUSY:
for(j = 0; j < 5; j++) {
for(j = 0; j < 5; j++)
{
rb_sleep(0, 500000);
if(!sqlite3_exec
(rb_bandb, buf, (cb ? rsdb_callback_func : NULL), (void *)((uintptr_t)cb), &errmsg))
@ -171,21 +180,26 @@ rsdb_exec_fetch(struct rsdb_table *table, const char *format, ...)
retval = rs_vsnprintf(buf, sizeof(buf), format, args);
va_end(args);
if(retval >= sizeof(buf)) {
if(retval >= sizeof(buf))
{
mlog("fatal error: length problem with compiling sql");
}
if((retval =
sqlite3_get_table(rb_bandb, buf, &data, &table->row_count, &table->col_count, &errmsg))) {
sqlite3_get_table(rb_bandb, buf, &data, &table->row_count, &table->col_count, &errmsg)))
{
int success = 0;
switch (retval) {
switch (retval)
{
case SQLITE_BUSY:
for(i = 0; i < 5; i++) {
for(i = 0; i < 5; i++)
{
rb_sleep(0, 500000);
if(!sqlite3_get_table
(rb_bandb, buf, &data, &table->row_count, &table->col_count,
&errmsg)) {
&errmsg))
{
success++;
break;
}
@ -206,7 +220,8 @@ rsdb_exec_fetch(struct rsdb_table *table, const char *format, ...)
/* we need to be able to free data afterward */
table->arg = data;
if(table->row_count == 0) {
if(table->row_count == 0)
{
table->row = NULL;
return;
}
@ -214,10 +229,12 @@ rsdb_exec_fetch(struct rsdb_table *table, const char *format, ...)
/* sqlite puts the column names as the first row */
pos = table->col_count;
table->row = rb_malloc(sizeof(char **) * table->row_count);
for(i = 0; i < table->row_count; i++) {
for(i = 0; i < table->row_count; i++)
{
table->row[i] = rb_malloc(sizeof(char *) * table->col_count);
for(j = 0; j < table->col_count; j++) {
for(j = 0; j < table->col_count; j++)
{
table->row[i][j] = data[pos++];
}
}
@ -228,7 +245,8 @@ rsdb_exec_fetch_end(struct rsdb_table *table)
{
int i;
for(i = 0; i < table->row_count; i++) {
for(i = 0; i < table->row_count; i++)
{
rb_free(table->row[i]);
}
rb_free(table->row);

22
configure vendored
View File

@ -1,8 +1,8 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for elemental-ircd 6.6.1.
# Generated by GNU Autoconf 2.69 for elemental-ircd 6.5.1.
#
# 2014 elemental-ircd Team
# $Id: configure.ac 3516 2007-06-10 16:14:03Z jilles $
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@ -579,8 +579,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='elemental-ircd'
PACKAGE_TARNAME='elemental-ircd'
PACKAGE_VERSION='6.6.1'
PACKAGE_STRING='elemental-ircd 6.6.1'
PACKAGE_VERSION='6.5.1'
PACKAGE_STRING='elemental-ircd 6.5.1'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@ -1303,7 +1303,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures elemental-ircd 6.6.1 to adapt to many kinds of systems.
\`configure' configures elemental-ircd 6.5.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1364,7 +1364,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of elemental-ircd 6.6.1:";;
short | recursive ) echo "Configuration of elemental-ircd 6.5.1:";;
esac
cat <<\_ACEOF
@ -1488,14 +1488,14 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
elemental-ircd configure 6.6.1
elemental-ircd configure 6.5.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
2014 elemental-ircd Team
$Id: configure.ac 3516 2007-06-10 16:14:03Z jilles $
_ACEOF
exit
fi
@ -2092,7 +2092,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by elemental-ircd $as_me 6.6.1, which was
It was created by elemental-ircd $as_me 6.5.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -10100,7 +10100,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by elemental-ircd $as_me 6.6.1, which was
This file was extended by elemental-ircd $as_me 6.5.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -10166,7 +10166,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
elemental-ircd config.status 6.6.1
elemental-ircd config.status 6.5.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@ -8,9 +8,9 @@ dnl said functions need to be just about as complex as they already are.
AC_PREREQ(2.57)
dnl Sneaky way to get an Id tag into the configure script
AC_COPYRIGHT([2014 elemental-ircd Team])
AC_COPYRIGHT([$Id: configure.ac 3516 2007-06-10 16:14:03Z jilles $])
AC_INIT([elemental-ircd],[6.6.1])
AC_INIT([elemental-ircd],[6.5.1])
AC_CONFIG_HEADER(include/setup.h)
@ -253,7 +253,7 @@ AC_SUBST([pkglibdir])
AC_SUBST([rundir])
AC_SUBST([pkgrundir])
AC_SUBST([pkglocalstatedir])
AC_DEFINE_DIR([PKGLOCALSTATEDIR], [pkglocalstatedir], [[Directory in which to store state, such as ban database]])
AC_DEFINE_DIR([PKGLOCALSTATEDIR], [pkglocalstatedir], [[Directory in which to store state, such as band database]])
AC_SUBST([pkglibexecdir])
AC_DEFINE_DIR([PKGLIBEXECDIR], [pkglibexecdir], [Directory where binaries the IRCd itself spawns live])

View File

@ -3,7 +3,6 @@
* Copyright (C) 2000-2002 Hybrid Development Team
* Copyright (C) 2002-2005 ircd-ratbox development team
* Copyright (C) 2005-2006 charybdis development team
* Copyright (C) 2014 Elemental-IRCd development team
*
* $Id: example.conf 3582 2007-11-17 21:55:48Z jilles $
*
@ -48,10 +47,10 @@ loadmodule "extensions/sno_globaloper.so";
#loadmodule "extensions/sno_whois.so";
serverinfo {
name = "hostname.domain.tld";
name = "hades.arpa";
sid = "42X";
description = "elemental-ircd test server";
network_name = "ShadowNET";
description = "shadowircd test server";
network_name = "AthemeNET";
network_desc = "Your IRC network.";
helpchan = "#help";
helpurl = "http://www.mynet.net/help";
@ -91,7 +90,7 @@ serverinfo {
admin {
name = "Lazy admin (lazya)";
description = "ShadowNET client server";
description = "AthemeNET client server";
email = "nobody@127.0.0.1";
};
@ -140,8 +139,7 @@ listen {
/* defer_accept: wait for clients to send IRC handshake data before
* accepting them. if you intend to use software which depends on the
* server replying first, such as BOPM, you should disable this feature.
* otherwise, you probably want to leave it on. Disabling this will not
* update on a rehash.
* otherwise, you probably want to leave it on.
*/
defer_accept = yes;
@ -200,6 +198,11 @@ auth {
*/
autojoin = "#shadowircd,#test";
/* autojoin_opers : Channel (or channels, comma-seperated) to join
* opers to on oper-up.
*/
autojoin_opers = "#opers,#help";
/* Possible flags in auth:
*
* encrypted | password is encrypted with mkpasswd
@ -427,7 +430,7 @@ serverhide {
* They are used in pairs of one host/rejection reason.
*
* These settings should be adequate for most networks, and are (presently)
* required for use on ShadowNet.
* required for use on AthemeNet.
*
* Word to the wise: Do not use blacklists like SPEWS for blocking IRC
* connections.
@ -441,6 +444,9 @@ serverhide {
* ${nick} - the user's nickname
* ${network-name} - the name of the network
*
* Note: AHBL (the providers of the below *.ahbl.org BLs) request that they be
* contacted, via email, at admins@2mbit.com before using these BLs.
* See <http://www.ahbl.org/services.php> for more information.
*/
blacklist {
host = "rbl.efnetrbl.org";
@ -449,8 +455,11 @@ blacklist {
host = "dnsbl.dronebl.org";
reject_reason = "${nick}, your IP (${ip}) is listed in DroneBL. For assistance, see http://dronebl.org/lookup_branded.do?ip=${ip}&network=${network-name}";
host = "torexit.dan.me.uk";
reject_reason = "${nick}, your IP (${ip}) is listed as a TOR exit node. In order to protect ${network-name} from TOR-based abuse, we are not allowing TOR exit nodes to connect to our network.";
# host = "ircbl.ahbl.org";
# reject_reason = "${nick}, your IP (${ip}) is listed in ${dnsbl-host} for having an open proxy. In order to protect ${network-name} from abuse, we are not allowing connections with open proxies to connect.";
#
# host = "tor.ahbl.org";
# reject_reason = "${nick}, your IP (${ip}) is listed as a TOR exit node. In order to protect ${network-name} from tor-based abuse, we are not allowing TOR exit nodes to connect to our network.";
};
alias "NickServ" {
@ -531,7 +540,7 @@ general {
default_operstring = "is an IRC Operator";
default_adminstring = "is a Server Administrator";
#default_operhost = "staff.testnet.net";
default_operhost = "staff.testnet.net";
#static_quit = "I like turtles!";
servicestring = "is a Network Service";
disable_fake_channels = no;

View File

@ -1,2 +1,2 @@
This is the Elemental-IRCd MOTD. You can use this if you like;
but if you do, your teacher may send you to magic kindergarten.
This is ShadowIRCd MOTD. You might replace it, but if not, your friends will
laugh at you.

View File

@ -373,6 +373,11 @@ auth {
*/
autojoin = "#shadowircd,#test";
/* autojoin_opers : Channel (or channels, comma-seperated) to join
* opers to on oper-up.
*/
autojoin_opers = "#opers,#help";
/* Possible flags in auth:
*
* encrypted | password is encrypted with mkpasswd
@ -962,6 +967,9 @@ serverhide {
* ${nick} - the user's nickname
* ${network-name} - the name of the network
*
* Note: AHBL (the providers of the below *.ahbl.org BLs) request that they be
* contacted, via email, at admins@2mbit.com before using these BLs.
* See <http://www.ahbl.org/services.php> for more information.
*/
blacklist {
host = "rbl.efnetrbl.org";
@ -969,6 +977,12 @@ blacklist {
host = "dnsbl.dronebl.org";
reject_reason = "${nick}, your IP (${ip}) is listed in DroneBL. For assistance, see http://dronebl.org/lookup_branded.do?ip=${ip}&network=${network-name}";
# host = "ircbl.ahbl.org";
# reject_reason = "${nick}, your IP (${ip}) is listed in ${dnsbl-host} for having an open proxy. In order to protect ${network-name} from abuse, we are not allowing connections with open proxies to connect.";
#
# host = "tor.ahbl.org";
# reject_reason = "${nick}, your IP (${ip}) is listed as a TOR exit node. In order to protect ${network-name} from tor-based abuse, we are not allowing TOR exit nodes to connect to our network.";
};
/*

View File

@ -376,6 +376,11 @@ auth {
*/
autojoin = "#shadowircd,#test";
/* autojoin_opers : Channel (or channels, comma-seperated) to join
* opers to on oper-up.
*/
autojoin_opers = "#opers,#help";
/* Possible flags in auth:
*
* encrypted | password is encrypted with mkpasswd
@ -965,6 +970,9 @@ serverhide {
* ${nick} - the user's nickname
* ${network-name} - the name of the network
*
* Note: AHBL (the providers of the below *.ahbl.org BLs) request that they be
* contacted, via email, at admins@2mbit.com before using these BLs.
* See <http://www.ahbl.org/services.php> for more information.
*/
blacklist {
host = "rbl.efnetrbl.org";
@ -972,6 +980,12 @@ blacklist {
host = "dnsbl.dronebl.org";
reject_reason = "${nick}, your IP (${ip}) is listed in DroneBL. For assistance, see http://dronebl.org/lookup_branded.do?ip=${ip}&network=${network-name}";
# host = "ircbl.ahbl.org";
# reject_reason = "${nick}, your IP (${ip}) is listed in ${dnsbl-host} for having an open proxy. In order to protect ${network-name} from abuse, we are not allowing connections with open proxies to connect.";
#
# host = "tor.ahbl.org";
# reject_reason = "${nick}, your IP (${ip}) is listed as a TOR exit node. In order to protect ${network-name} from tor-based abuse, we are not allowing TOR exit nodes to connect to our network.";
};
/*

View File

@ -52,17 +52,3 @@ servers and check. Bots or pseudoservices may also uses these lines to perform
additional actions (such as `AKILL`s or logging to channels) as needed by the
bot author.
#### METADATA
The old ShadowIRCD implementation of METADATA used `ADD` and `DELETE` verbs for
adding and deleting metadata to channels and clients. This, in practice looks
something like:
<<< :45X ENCAP * METADATA ADD 1NRAAAABR OPERSTRING :is an IRC Administrator
<<< :45X ENCAP * METADATA DELETE 1NRAAAABR OPERSTRING
Functionality is identical to the new `SET` and `CLEAR` verbs, but this deviates
from the spec by being **only** a server to server command. Support for client
to server and server to client metadata setting/getting will come in a future
version of elemental-ircd.

View File

@ -53,7 +53,6 @@ SRCS = \
force_user_invis.c \
hurt.c \
ip_cloaking.c \
ip_cloaking-5.c \
sno_farconnect.c \
sno_globalkline.c \
sno_globaloper.c \

View File

@ -45,7 +45,7 @@ h_can_join(hook_data_channel *data)
struct Channel *chptr = data->chptr;
if((chptr->mode.mode & mymode) && !IsSSLClient(source_p)) {
sendto_one_notice(source_p, ":Only users using SSL can join this channel!");
sendto_one_notice(source_p, ":Only users using SSL could join this channel!");
data->approved = ERR_CUSTOM;
}
}

View File

@ -31,7 +31,8 @@ h_can_create_channel_authenticated(hook_data_client_approval *data)
{
struct Client *source_p = data->client;
if (!IsOper(source_p)) {
if (!IsOper(source_p))
{
sendto_one_notice(source_p, ":*** Channel creation is restricted to network staff only.");
data->approved = ERR_NEEDREGGEDNICK;
}

View File

@ -159,9 +159,12 @@ DECLARE_MODULE_AV1(
static int
munreg_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
if(parc < 2) {
if(parc < 2)
{
sendto_one_notice(source_p, ":You are unregistered and sent no parameters");
} else {
}
else
{
sendto_one_notice(source_p, ":You are unregistered and sent parameter: %s", parv[1]);
}
@ -178,9 +181,12 @@ munreg_test(struct Client *client_p, struct Client *source_p, int parc, const ch
static int
mclient_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
if(parc < 2) {
if(parc < 2)
{
sendto_one_notice(source_p, ":You are a normal user, and sent no parameters");
} else {
}
else
{
sendto_one_notice(source_p, ":You are a normal user, and send parameters: %s", parv[1]);
}
@ -197,9 +203,12 @@ mclient_test(struct Client *client_p, struct Client *source_p, int parc, const c
static int
mrclient_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
if(parc < 2) {
if(parc < 2)
{
sendto_one_notice(source_p, ":You are a remote client, and sent no parameters");
} else {
}
else
{
sendto_one_notice(source_p, ":You are a remote client, and sent parameters: %s", parv[1]);
}
return 0;
@ -212,9 +221,12 @@ mrclient_test(struct Client *client_p, struct Client *source_p, int parc, const
static int
mserver_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
if(parc < 2) {
if(parc < 2)
{
sendto_one_notice(source_p, ":You are a server, and sent no parameters");
} else {
}
else
{
sendto_one_notice(source_p, ":You are a server, and sent parameters: %s", parv[1]);
}
return 0;
@ -227,9 +239,12 @@ mserver_test(struct Client *client_p, struct Client *source_p, int parc, const c
static int
moper_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
if(parc < 2) {
if(parc < 2)
{
sendto_one_notice(source_p, ":You are an operator, and sent no parameters");
} else {
}
else
{
sendto_one_notice(source_p, ":You are an operator, and sent parameters: %s", parv[1]);
}
return 0;

View File

@ -41,13 +41,14 @@ static int eb_extended(const char *data, struct Client *client_p,
if (data == NULL)
return EXTBAN_INVALID;
snprintf(buf, BUFSIZE, "%s!%s@%s#%s",
rb_snprintf(buf, BUFSIZE, "%s!%s@%s#%s",
client_p->name, client_p->username, client_p->host, client_p->info);
ret = match(data, buf) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
if (ret == EXTBAN_NOMATCH && IsDynSpoof(client_p)) {
snprintf(buf, BUFSIZE, "%s!%s@%s#%s",
if (ret == EXTBAN_NOMATCH && IsDynSpoof(client_p))
{
rb_snprintf(buf, BUFSIZE, "%s!%s@%s#%s",
client_p->name, client_p->username, client_p->orighost, client_p->info);
ret = match(data, buf) ? EXTBAN_MATCH : EXTBAN_NOMATCH;

View File

@ -156,7 +156,8 @@ modfini(void)
rb_event_delete(hurt_expire_ev);
rb_event_delete(hurt_check_ev);
RB_DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_state.hurt_clients.head) {
RB_DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_state.hurt_clients.head)
{
rb_dlinkDestroy(ptr, &hurt_state.hurt_clients);
}
}
@ -206,18 +207,23 @@ mo_hurt(struct Client *client_p, struct Client *source_p,
}
/* Is this a client? */
if (strchr(ip, '.') == NULL && strchr(ip, ':') == NULL) {
if (strchr(ip, '.') == NULL && strchr(ip, ':') == NULL)
{
target_p = find_named_person(ip);
if (target_p == NULL) {
if (target_p == NULL)
{
sendto_one_numeric(source_p, ERR_NOSUCHNICK,
form_str(ERR_NOSUCHNICK), ip);
return 0;
}
ip = target_p->orighost;
} else {
}
else
{
if (!strncmp(ip, "*@", 2))
ip += 2;
if (strchr(ip, '!') || strchr(ip, '@')) {
if (strchr(ip, '!') || strchr(ip, '@'))
{
sendto_one_notice(source_p, ":Invalid HURT mask [%s]",
ip);
return 0;
@ -296,15 +302,18 @@ mo_heal(struct Client *client_p, struct Client *source_p,
{
struct Client *target_p;
if (!IsOperUnkline(source_p)) {
if (!IsOperUnkline(source_p))
{
sendto_one(source_p, form_str(ERR_NOPRIVS),
me.name, source_p->name, "unkline");
return 0;
}
if (nick_is_valid(parv[1])) {
if (nick_is_valid(parv[1]))
{
target_p = find_named_person(parv[1]);
if (target_p == NULL) {
if (target_p == NULL)
{
sendto_one_numeric(source_p, ERR_NOSUCHNICK,
form_str(ERR_NOSUCHNICK), parv[1]);
return 0;
@ -316,8 +325,11 @@ mo_heal(struct Client *client_p, struct Client *source_p,
get_id(source_p, target_p),
target_p->servptr->name,
get_id(target_p, target_p));
} else if (strchr(parv[1], '.')) {
if (hurt_find_exact(parv[1]) == NULL) {
}
else if (strchr(parv[1], '.'))
{
if (hurt_find_exact(parv[1]) == NULL)
{
sendto_one_notice(source_p, ":Mask [%s] is not HURT", parv[1]);
return 0;
}
@ -326,7 +338,9 @@ mo_heal(struct Client *client_p, struct Client *source_p,
get_oper_name(source_p), parv[1]);
sendto_server(NULL, NULL, NOCAPS, NOCAPS, ":%s ENCAP * HEAL %s",
source_p->name, parv[1]);
} else {
}
else
{
sendto_one(source_p, ":[%s] is not a valid IP address/nick", parv[1]);
return 0;
}
@ -347,18 +361,22 @@ me_heal(struct Client *client_p, struct Client *source_p,
if (parc < 2)
return 0;
if (nick_is_valid(parv[1])) {
if (nick_is_valid(parv[1]))
{
target_p = find_person(parv[1]);
if (target_p != NULL && MyConnect(target_p))
heal_nick(source_p, target_p);
} else if (strchr(parv[1], '.')) { /* host or mask to remove ban for */
}
else if (strchr(parv[1], '.')) /* host or mask to remove ban for */
{
if (hurt_find_exact(parv[1]) == NULL)
return 0;
hurt_remove(parv[1]);
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s removed HURT on %s",
get_oper_name(source_p), parv[1]);
} else
}
else
return 0;
return 0;
@ -377,11 +395,13 @@ hurt_check_event(void *arg)
RB_DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_state.hurt_clients.head) {
client_p = ptr->data;
if (!EmptyString(client_p->user->suser)) {
if (!EmptyString(client_p->user->suser))
{
rb_dlinkDestroy(ptr, &hurt_state.hurt_clients);
sendto_one_notice(client_p, ":HURT restriction removed for this session");
client_p->localClient->target_last = rb_current_time(); /* don't ask --nenolod */
} else if (client_p->localClient->receiveM > hurt_state.cutoff)
}
else if (client_p->localClient->receiveM > hurt_state.cutoff)
exit_client(NULL, client_p, &me, hurt_state.exit_reason);
}
}
@ -394,10 +414,12 @@ hurt_expire_event(void *unused)
rb_dlink_node *ptr, *next_ptr;
hurt_t *hurt;
RB_DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_confs.head) {
RB_DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_confs.head)
{
hurt = (hurt_t *) ptr->data;
if (hurt->expire <= rb_current_time()) {
if (hurt->expire <= rb_current_time())
{
rb_dlinkFindDestroy(hurt, &hurt_confs);
hurt_destroy(hurt);
}
@ -428,7 +450,8 @@ new_local_user_hook(struct Client *source_p)
IsExemptKline(source_p))
return;
if (hurt_find(source_p->sockhost) || hurt_find(source_p->orighost)) {
if (hurt_find(source_p->sockhost) || hurt_find(source_p->orighost))
{
source_p->localClient->target_last = rb_current_time() + 600; /* don't ask --nenolod */
SetTGChange(source_p);
rb_dlinkAddAlloc(source_p, &hurt_state.hurt_clients);
@ -453,9 +476,11 @@ doing_stats_hook(hook_data_int *hdata)
return;
if((ConfigFileEntry.stats_k_oper_only == 2) && !IsOper(source_p))
return;
if ((ConfigFileEntry.stats_k_oper_only == 1) && !IsOper(source_p)) {
if ((ConfigFileEntry.stats_k_oper_only == 1) && !IsOper(source_p))
{
hurt = hurt_find(source_p->sockhost);
if (hurt != NULL) {
if (hurt != NULL)
{
sendto_one_numeric(source_p, RPL_STATSKLINE,
form_str(RPL_STATSKLINE), 's',
"*", hurt->ip, hurt->reason, "", "");
@ -463,7 +488,8 @@ doing_stats_hook(hook_data_int *hdata)
}
hurt = hurt_find(source_p->orighost);
if (hurt != NULL) {
if (hurt != NULL)
{
sendto_one_numeric(source_p, RPL_STATSKLINE,
form_str(RPL_STATSKLINE), 's',
"*", hurt->ip, hurt->reason, "", "");
@ -472,7 +498,8 @@ doing_stats_hook(hook_data_int *hdata)
return;
}
RB_DLINK_FOREACH(ptr, hurt_confs.head) {
RB_DLINK_FOREACH(ptr, hurt_confs.head)
{
hurt = (hurt_t *) ptr->data;
sendto_one_numeric(source_p, RPL_STATSKLINE,
form_str(RPL_STATSKLINE), 's',
@ -550,7 +577,8 @@ hurt_find_exact(const char *ip)
rb_dlink_node *ptr;
hurt_t *hurt;
RB_DLINK_FOREACH(ptr, hurt_confs.head) {
RB_DLINK_FOREACH(ptr, hurt_confs.head)
{
hurt = (hurt_t *) ptr->data;
if (!strcasecmp(ip, hurt->ip))
@ -566,7 +594,8 @@ hurt_find(const char *ip)
rb_dlink_node *ptr;
hurt_t *hurt;
RB_DLINK_FOREACH(ptr, hurt_confs.head) {
RB_DLINK_FOREACH(ptr, hurt_confs.head)
{
hurt = (hurt_t *) ptr->data;
if (match(hurt->ip, ip))
@ -589,14 +618,17 @@ hurt_remove(const char *ip)
static int
heal_nick(struct Client *source_p, struct Client *target_p)
{
if (rb_dlinkFindDestroy(target_p, &hurt_state.hurt_clients)) {
if (rb_dlinkFindDestroy(target_p, &hurt_state.hurt_clients))
{
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s used HEAL on %s",
get_oper_name(source_p), get_client_name(target_p, HIDE_IP));
sendto_one_notice(target_p, ":HURT restriction temporarily removed by operator");
sendto_one_notice(source_p, ":HURT restriction on %s temporarily removed", target_p->name);
target_p->localClient->target_last = rb_current_time(); /* don't ask --nenolod */
return 1;
} else {
}
else
{
sendto_one_notice(source_p, ":%s was not hurt", target_p->name);
return 0;
}

View File

@ -1,160 +0,0 @@
/*
* Charybdis: an advanced ircd
* ip_cloaking.c: provide user hostname cloaking
*
* Written originally by nenolod, altered to use FNV by Elizabeth in 2008
* altered some more by groente
*/
#include <openssl/hmac.h>
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include "hash.h"
#include "s_conf.h"
#include "s_user.h"
#include "s_serv.h"
#include "numeric.h"
#include "newconf.h"
char *secretsalt = "32qwnqoWI@DpMd&w";
static void
conf_set_secretsalt(void *data)
{
secretsalt = rb_strdup(data);
}
static int
_modinit(void)
{
/* add the usermode to the available slot */
user_modes['x'] = find_umode_slot();
construct_umodebuf();
add_top_conf("cloaking", NULL, NULL, NULL);
add_conf_item("cloaking", "secretsalt", CF_QSTRING, conf_set_secretsalt);
return 0;
}
static void
_moddeinit(void)
{
/* disable the umode and remove it from the available list */
user_modes['x'] = 0;
construct_umodebuf();
add_top_conf("cloaking", NULL, NULL, NULL);
add_conf_item("cloaking", "secretsalt", CF_QSTRING, conf_set_secretsalt);
}
static void check_umode_change(void *data);
static void check_new_user(void *data);
mapi_hfn_list_av1 ip_cloaking_hfnlist[] = {
{ "umode_changed", (hookfn) check_umode_change },
{ "new_local_user", (hookfn) check_new_user },
{ NULL, NULL }
};
DECLARE_MODULE_AV1(ip_cloaking, _modinit, _moddeinit, NULL, NULL,
ip_cloaking_hfnlist, "$Revision: 3526 $");
static void
distribute_hostchange(struct Client *client_p, char *newhost)
{
if (newhost != client_p->orighost)
sendto_one_numeric(client_p, RPL_HOSTHIDDEN, "%s :is now your hidden host",
newhost);
else
sendto_one_numeric(client_p, RPL_HOSTHIDDEN, "%s :hostname reset",
newhost);
sendto_server(NULL, NULL,
CAP_EUID | CAP_TS6, NOCAPS, ":%s CHGHOST %s :%s",
use_id(&me), use_id(client_p), newhost);
sendto_server(NULL, NULL,
CAP_TS6, CAP_EUID, ":%s ENCAP * CHGHOST %s :%s",
use_id(&me), use_id(client_p), newhost);
change_nick_user_host(client_p, client_p->name, client_p->username, newhost, 0, "Changing host");
if (newhost != client_p->orighost)
SetDynSpoof(client_p);
else
ClearDynSpoof(client_p);
}
static void
do_host_cloak(const char *inbuf, char *outbuf)
{
unsigned char *hash;
char buf[3];
char output[HOSTLEN+1];
int i;
hash = HMAC(EVP_sha256(), secretsalt, strlen(secretsalt), (unsigned char*)inbuf, strlen(inbuf), NULL, NULL);
output[0]=0;
for (i = 0; i < 32; i++) {
sprintf(buf, "%.2x", hash[i]);
strcat(output,buf);
}
rb_strlcpy(outbuf,output,HOSTLEN+1);
}
static void
check_umode_change(void *vdata)
{
hook_data_umode_changed *data = (hook_data_umode_changed *)vdata;
struct Client *source_p = data->client;
if (!MyClient(source_p))
return;
/* didn't change +h umode, we don't need to do anything */
if (!((data->oldumodes ^ source_p->umodes) & user_modes['x']))
return;
if (source_p->umodes & user_modes['h']) {
if (IsIPSpoof(source_p) || source_p->localClient->mangledhost == NULL || (IsDynSpoof(source_p) && strcmp(source_p->host, source_p->localClient->mangledhost))) {
source_p->umodes &= ~user_modes['x'];
return;
}
if (strcmp(source_p->host, source_p->localClient->mangledhost)) {
distribute_hostchange(source_p, source_p->localClient->mangledhost);
} else /* not really nice, but we need to send this numeric here */
sendto_one_numeric(source_p, RPL_HOSTHIDDEN, "%s :is now your hidden host",
source_p->host);
} else if (!(source_p->umodes & user_modes['x'])) {
if (source_p->localClient->mangledhost != NULL &&
!strcmp(source_p->host, source_p->localClient->mangledhost)) {
distribute_hostchange(source_p, source_p->orighost);
}
}
}
static void
check_new_user(void *vdata)
{
struct Client *source_p = (void *)vdata;
if (IsIPSpoof(source_p)) {
source_p->umodes &= ~user_modes['x'];
return;
}
source_p->localClient->mangledhost = rb_malloc(HOSTLEN + 1);
do_host_cloak(source_p->orighost, source_p->localClient->mangledhost);
if (IsDynSpoof(source_p))
source_p->umodes &= ~user_modes['x'];
if (source_p->umodes & user_modes['x']) {
rb_strlcpy(source_p->host, source_p->localClient->mangledhost, sizeof(source_p->host));
if (irccmp(source_p->host, source_p->orighost))
SetDynSpoof(source_p);
}
}

View File

@ -84,7 +84,8 @@ do_host_cloak_ip(const char *inbuf, char *outbuf)
rb_strlcpy(outbuf, inbuf, HOSTLEN + 1);
if (strchr(outbuf, ':')) {
if (strchr(outbuf, ':'))
{
ipv6 = 1;
/* Damn you IPv6...
@ -98,11 +99,14 @@ do_host_cloak_ip(const char *inbuf, char *outbuf)
for (tptr = outbuf; *tptr != '\0'; tptr++)
if (*tptr == ':')
totalcount++;
} else if (!strchr(outbuf, '.'))
}
else if (!strchr(outbuf, '.'))
return;
for (tptr = outbuf; *tptr != '\0'; tptr++) {
if (*tptr == ':' || *tptr == '.') {
for (tptr = outbuf; *tptr != '\0'; tptr++)
{
if (*tptr == ':' || *tptr == '.')
{
sepcount++;
continue;
}
@ -132,7 +136,8 @@ do_host_cloak_host(const char *inbuf, char *outbuf)
*
* numbers are not changed at this time, only letters.
*/
for (tptr = outbuf; *tptr != '\0'; tptr++) {
for (tptr = outbuf; *tptr != '\0'; tptr++)
{
if (*tptr == '.')
break;
@ -146,7 +151,8 @@ do_host_cloak_host(const char *inbuf, char *outbuf)
}
/* pass 2: scramble each number in the address */
for (tptr = outbuf; *tptr != '\0'; tptr++) {
for (tptr = outbuf; *tptr != '\0'; tptr++)
{
if (isdigit(*tptr))
*tptr = '0' + (*tptr + accum) % 10;
@ -167,19 +173,26 @@ check_umode_change(void *vdata)
if (!((data->oldumodes ^ source_p->umodes) & user_modes['x']))
return;
if (source_p->umodes & user_modes['x']) {
if (IsIPSpoof(source_p) || source_p->localClient->mangledhost == NULL || (IsDynSpoof(source_p) && strcmp(source_p->host, source_p->localClient->mangledhost))) {
if (source_p->umodes & user_modes['x'])
{
if (IsIPSpoof(source_p) || source_p->localClient->mangledhost == NULL || (IsDynSpoof(source_p) && strcmp(source_p->host, source_p->localClient->mangledhost)))
{
source_p->umodes &= ~user_modes['x'];
return;
}
if (strcmp(source_p->host, source_p->localClient->mangledhost)) {
if (strcmp(source_p->host, source_p->localClient->mangledhost))
{
distribute_hostchange(source_p, source_p->localClient->mangledhost);
} else /* not really nice, but we need to send this numeric here */
}
else /* not really nice, but we need to send this numeric here */
sendto_one_numeric(source_p, RPL_HOSTHIDDEN, "%s :is now your hidden host",
source_p->host);
} else if (!(source_p->umodes & user_modes['x'])) {
}
else if (!(source_p->umodes & user_modes['x']))
{
if (source_p->localClient->mangledhost != NULL &&
!strcmp(source_p->host, source_p->localClient->mangledhost)) {
!strcmp(source_p->host, source_p->localClient->mangledhost))
{
distribute_hostchange(source_p, source_p->orighost);
}
}
@ -190,7 +203,8 @@ check_new_user(void *vdata)
{
struct Client *source_p = (void *)vdata;
if (IsIPSpoof(source_p)) {
if (IsIPSpoof(source_p))
{
source_p->umodes &= ~user_modes['x'];
return;
}
@ -201,7 +215,8 @@ check_new_user(void *vdata)
do_host_cloak_host(source_p->orighost, source_p->localClient->mangledhost);
if (IsDynSpoof(source_p))
source_p->umodes &= ~user_modes['x'];
if (source_p->umodes & user_modes['x']) {
if (source_p->umodes & user_modes['x'])
{
rb_strlcpy(source_p->host, source_p->localClient->mangledhost, sizeof(source_p->host));
if (irccmp(source_p->host, source_p->orighost))
SetDynSpoof(source_p);

View File

@ -14,8 +14,7 @@ static int mclient_42(struct Client *client_p, struct Client *source_p, int parc
struct Message hgtg_msgtab = {
"42", 0, 0, 0, MFLG_SLOW,
{
mg_ignore, {mclient_42, 0}, mg_ignore, mg_ignore, mg_ignore, {mclient_42, 0}
{ mg_ignore, {mclient_42, 0}, mg_ignore, mg_ignore, mg_ignore, {mclient_42, 0}
}
};

View File

@ -58,7 +58,8 @@ DECLARE_MODULE_AV1(adminwall, NULL, NULL, adminwall_clist, NULL, NULL, "$Revisio
static int
mo_adminwall(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
if(!IsAdmin(source_p)) {
if(!IsAdmin(source_p))
{
sendto_one(source_p, form_str(ERR_NOPRIVS),
me.name, source_p->name, "adminwall");
return 0;

View File

@ -46,14 +46,17 @@ m_cycle(struct Client *client_p, struct Client *source_p, int parc, const char *
if(MyClient(source_p) && !IsFloodDone(source_p))
flood_endgrace(source_p);
while(name) {
if((chptr = find_channel(name)) == NULL) {
while(name)
{
if((chptr = find_channel(name)) == NULL)
{
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL, form_str(ERR_NOSUCHCHANNEL), name);
return 0;
}
msptr = find_channel_membership(chptr, source_p);
if(msptr == NULL) {
if(msptr == NULL)
{
sendto_one_numeric(source_p, ERR_NOTONCHANNEL, form_str(ERR_NOTONCHANNEL), name);
return 0;
}
@ -64,13 +67,16 @@ m_cycle(struct Client *client_p, struct Client *source_p, int parc, const char *
if((is_any_op(msptr) || !MyConnect(source_p) ||
((can_send(chptr, source_p, msptr) > 0 &&
(source_p->localClient->firsttime +
ConfigFileEntry.anti_spam_exit_message_time) < rb_current_time())))) {
ConfigFileEntry.anti_spam_exit_message_time) < rb_current_time()))))
{
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
":%s PART %s :Cycling", use_id(source_p), chptr->chname);
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s PART %s :Cycling",
source_p->name, source_p->username,
source_p->host, chptr->chname);
} else {
}
else
{
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
":%s PART %s", use_id(source_p), chptr->chname);
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s PART %s",

View File

@ -62,31 +62,39 @@ m_findforwards(struct Client *client_p, struct Client *source_p, int parc, const
*p = '\0';
/* Allow ircops to search for forwards to nonexistent channels */
if(!IsOper(source_p)) {
if((chptr = find_channel(parv[1])) == NULL || (msptr = find_channel_membership(chptr, source_p)) == NULL) {
if(!IsOper(source_p))
{
if((chptr = find_channel(parv[1])) == NULL || (msptr = find_channel_membership(chptr, source_p)) == NULL)
{
sendto_one_numeric(source_p, ERR_NOTONCHANNEL,
form_str(ERR_NOTONCHANNEL), parv[1]);
return 0;
}
if(!is_any_op(msptr)) {
if(!is_any_op(msptr))
{
sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
me.name, source_p->name, parv[1]);
return 0;
}
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time()) {
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
{
sendto_one(source_p, form_str(RPL_LOAD2HI),
me.name, source_p->name, "FINDFORWARDS");
return 0;
} else
}
else
last_used = rb_current_time();
}
RB_DLINK_FOREACH(ptr, global_channel_list.head) {
RB_DLINK_FOREACH(ptr, global_channel_list.head)
{
chptr = ptr->data;
if(chptr->mode.forward && !irccmp(chptr->mode.forward, parv[1])) {
if(p + strlen(chptr->chname) >= end - 13) {
if(chptr->mode.forward && !irccmp(chptr->mode.forward, parv[1]))
{
if(p + strlen(chptr->chname) >= end - 13)
{
strcpy(p, "<truncated> ");
p += 12;
break;

View File

@ -74,7 +74,8 @@ mo_forcejoin(struct Client *client_p, struct Client *source_p, int parc, const c
char sjmode;
char *newch;
if(!IsOperAdmin(source_p)) {
if(!IsOperAdmin(source_p))
{
sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "admin");
return 0;
}
@ -85,7 +86,8 @@ mo_forcejoin(struct Client *client_p, struct Client *source_p, int parc, const c
/* if target_p is not existant, print message
* to source_p and bail - scuzzy
*/
if((target_p = find_client(parv[1])) == NULL) {
if((target_p = find_client(parv[1])) == NULL)
{
sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, source_p->name, parv[1]);
return 0;
}
@ -104,15 +106,20 @@ mo_forcejoin(struct Client *client_p, struct Client *source_p, int parc, const c
source_p->name, source_p->username, source_p->host);
/* select our modes from parv[2] if they exist... (chanop) */
if(*parv[2] == '@') {
if(*parv[2] == '@')
{
type = CHFL_CHANOP;
mode = 'o';
sjmode = '@';
} else if(*parv[2] == '+') {
}
else if(*parv[2] == '+')
{
type = CHFL_VOICE;
mode = 'v';
sjmode = '+';
} else {
}
else
{
type = CHFL_PEON;
mode = sjmode = '\0';
}
@ -120,8 +127,10 @@ mo_forcejoin(struct Client *client_p, struct Client *source_p, int parc, const c
if(mode != '\0')
parv[2]++;
if((chptr = find_channel(parv[2])) != NULL) {
if(IsMember(target_p, chptr)) {
if((chptr = find_channel(parv[2])) != NULL)
{
if(IsMember(target_p, chptr))
{
/* debugging is fun... */
sendto_one_notice(source_p, ":*** Notice -- %s is already in %s",
target_p->name, chptr->chname);
@ -143,7 +152,8 @@ mo_forcejoin(struct Client *client_p, struct Client *source_p, int parc, const c
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +%c %s",
me.name, chptr->chname, mode, target_p->name);
if(chptr->topic != NULL) {
if(chptr->topic != NULL)
{
sendto_one(target_p, form_str(RPL_TOPIC), me.name,
target_p->name, chptr->chname, chptr->topic);
sendto_one(target_p, form_str(RPL_TOPICWHOTIME),
@ -152,23 +162,28 @@ mo_forcejoin(struct Client *client_p, struct Client *source_p, int parc, const c
}
channel_member_names(chptr, target_p, 1);
} else {
}
else
{
newch = LOCAL_COPY(parv[2]);
if(!check_channel_name(newch)) {
if(!check_channel_name(newch))
{
sendto_one(source_p, form_str(ERR_BADCHANNAME), me.name,
source_p->name, (unsigned char *) newch);
return 0;
}
/* channel name must begin with & or # */
if(!IsChannelName(newch)) {
if(!IsChannelName(newch))
{
sendto_one(source_p, form_str(ERR_BADCHANNAME), me.name,
source_p->name, (unsigned char *) newch);
return 0;
}
/* newch can't be longer than CHANNELLEN */
if(strlen(newch) > CHANNELLEN) {
if(strlen(newch) > CHANNELLEN)
{
sendto_one_notice(source_p, ":Channel name is too long");
return 0;
}

View File

@ -65,11 +65,11 @@ DECLARE_MODULE_AV1(identify, NULL, NULL, identify_clist, NULL, NULL, "$Revision:
char *reconstruct_parv(int parc, const char *parv[])
{
static char tmpbuf[BUFSIZE];
int i;
static char tmpbuf[BUFSIZE]; int i;
rb_strlcpy(tmpbuf, parv[0], BUFSIZE);
for (i = 1; i < parc; i++) {
for (i = 1; i < parc; i++)
{
rb_strlcat(tmpbuf, " ", BUFSIZE);
rb_strlcat(tmpbuf, parv[i], BUFSIZE);
}
@ -81,15 +81,19 @@ static int m_identify(struct Client *client_p, struct Client *source_p, int parc
const char *nick;
struct Client *target_p;
if (parc < 2 || EmptyString(parv[1])) {
if (parc < 2 || EmptyString(parv[1]))
{
sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), me.name, source_p->name);
return 0;
}
nick = parv[1][0] == '#' ? SVS_chanserv_NICK : SVS_nickserv_NICK;
if ((target_p = find_named_person(nick)) && IsService(target_p)) {
if ((target_p = find_named_person(nick)) && IsService(target_p))
{
sendto_one(target_p, ":%s PRIVMSG %s :IDENTIFY %s", get_id(source_p, target_p), get_id(target_p, target_p), reconstruct_parv(parc - 1, &parv[1]));
} else {
}
else
{
sendto_one_numeric(source_p, ERR_SERVICESDOWN, form_str(ERR_SERVICESDOWN), nick);
}
return 0;

View File

@ -50,7 +50,8 @@ m_mkpasswd(struct Client *client_p, struct Client *source_p, int parc, const cha
const char *hashtype;
const char hashdefault[] = "SHA512";
if(EmptyString(parv[1])) {
if(EmptyString(parv[1]))
{
sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "MKPASSWD");
return 0;
}
@ -60,11 +61,13 @@ m_mkpasswd(struct Client *client_p, struct Client *source_p, int parc, const cha
else
hashtype = parv[2];
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time()) {
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
{
/* safe enough to give this on a local connect only */
sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name, "MKPASSWD");
return 0;
} else
}
else
last_used = rb_current_time();
if(!irccmp(hashtype, "SHA256"))
@ -73,7 +76,8 @@ m_mkpasswd(struct Client *client_p, struct Client *source_p, int parc, const cha
salt = make_sha512_salt(16);
else if(!irccmp(hashtype, "MD5"))
salt = make_md5_salt(8);
else {
else
{
sendto_one_notice(source_p,
":MKPASSWD syntax error: MKPASSWD pass [SHA256|SHA512|MD5]");
return 0;
@ -94,7 +98,8 @@ mo_mkpasswd(struct Client *client_p, struct Client *source_p, int parc, const ch
const char *hashtype;
const char hashdefault[] = "SHA512";
if(EmptyString(parv[1])) {
if(EmptyString(parv[1]))
{
sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "MKPASSWD");
return 0;
}
@ -110,7 +115,8 @@ mo_mkpasswd(struct Client *client_p, struct Client *source_p, int parc, const ch
salt = make_sha512_salt(16);
else if(!irccmp(hashtype, "MD5"))
salt = make_md5_salt(8);
else {
else
{
sendto_one_notice(source_p,
":MKPASSWD syntax error: MKPASSWD pass [SHA256|SHA512|MD5]");
return 0;
@ -124,7 +130,8 @@ char *
make_md5_salt(int length)
{
static char salt[21];
if(length > 16) {
if(length > 16)
{
printf("MD5 salt length too long\n");
exit(0);
}
@ -141,7 +148,8 @@ char *
make_sha256_salt(int length)
{
static char salt[21];
if(length > 16) {
if(length > 16)
{
printf("SHA256 salt length too long\n");
exit(0);
}
@ -158,7 +166,8 @@ char *
make_sha512_salt(int length)
{
static char salt[21];
if(length > 16) {
if(length > 16)
{
printf("SHA512 salt length too long\n");
exit(0);
}
@ -176,7 +185,8 @@ generate_poor_salt(char *salt, int length)
{
int i;
srand(time(NULL));
for(i = 0; i < length; i++) {
for(i = 0; i < length; i++)
{
salt[i] = saltChars[rand() % 64];
}
return (salt);
@ -187,16 +197,19 @@ generate_random_salt(char *salt, int length)
{
char *buf;
int fd, i;
if((fd = open("/dev/random", O_RDONLY)) < 0) {
if((fd = open("/dev/random", O_RDONLY)) < 0)
{
return (generate_poor_salt(salt, length));
}
buf = calloc(1, length);
if(read(fd, buf, length) != length) {
if(read(fd, buf, length) != length)
{
free(buf);
return (generate_poor_salt(salt, length));
}
for(i = 0; i < length; i++) {
for(i = 0; i < length; i++)
{
salt[i] = saltChars[abs(buf[i]) % 64];
}
free(buf);

View File

@ -25,23 +25,27 @@ mo_oaccept(struct Client *client_p, struct Client *source_p, int parc, const cha
struct Client *target_p;
char text[10];
if(!(target_p = find_client(parv[1]))) {
if(!(target_p = find_client(parv[1])))
{
sendto_one(source_p, form_str(ERR_NOSUCHNICK), parv[1]);
return 0;
}
/* If we don't check for this, and some idiot tries to OACCEPT a server... */
if(!IsPerson(target_p)) {
if(!IsPerson(target_p))
{
sendto_one_notice(source_p, ":That is a server, not a user. What are you doing?");
return 0;
}
snprintf(text, sizeof(text), "O%s", source_p->id);
rb_snprintf(text, sizeof(text), "O%s", source_p->id);
/* Provide a nice error message if you try to OACCEPT someone
* who you've already OACCEPTed. */
DICTIONARY_FOREACH(md, &iter, target_p->user->metadata) {
if(!strcmp(md->value, "OACCEPT") && !strcmp(md->name, text)) {
DICTIONARY_FOREACH(md, &iter, target_p->user->metadata)
{
if(!strcmp(md->value, "OACCEPT") && !strcmp(md->name, text))
{
sendto_one_notice(source_p, ":You're already on %s's OACCEPT list", target_p->name);
return 0;
}

View File

@ -58,23 +58,27 @@ mo_ojoin(struct Client *client_p, struct Client *source_p, int parc, const char
int move_me = 0;
/* admins only */
if(!IsOperAdmin(source_p)) {
if(!IsOperAdmin(source_p))
{
sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "admin");
return 0;
}
if(*parv[1] == '@' || *parv[1] == '%' || *parv[1] == '+' || *parv[1] == '!' || *parv[1] == '~') {
if(*parv[1] == '@' || *parv[1] == '%' || *parv[1] == '+' || *parv[1] == '!' || *parv[1] == '~')
{
parv[1]++;
move_me = 1;
}
if((chptr = find_channel(parv[1])) == NULL) {
if((chptr = find_channel(parv[1])) == NULL)
{
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
form_str(ERR_NOSUCHCHANNEL), parv[1]);
return 0;
}
if(IsMember(source_p, chptr)) {
if(IsMember(source_p, chptr))
{
sendto_one_notice(source_p, ":Please part %s before using OJOIN", parv[1]);
return 0;
}
@ -93,7 +97,8 @@ mo_ojoin(struct Client *client_p, struct Client *source_p, int parc, const char
me.name, parv[1],
source_p->name, source_p->username, source_p->host);
if(*parv[1] == '~' && ConfigChannel.use_owner) {
if(*parv[1] == '~' && ConfigChannel.use_owner)
{
add_user_to_channel(chptr, source_p, CHFL_OWNER);
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
":%s SJOIN %ld %s + :~%s",
@ -103,7 +108,9 @@ mo_ojoin(struct Client *client_p, struct Client *source_p, int parc, const char
source_p->username, source_p->host, chptr->chname);
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +y %s",
me.name, chptr->chname, source_p->name);
} else if(*parv[1] == '!' && ConfigChannel.use_admin) {
}
else if(*parv[1] == '!' && ConfigChannel.use_admin)
{
add_user_to_channel(chptr, source_p, CHFL_ADMIN);
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
":%s SJOIN %ld %s + :!%s",
@ -114,7 +121,9 @@ mo_ojoin(struct Client *client_p, struct Client *source_p, int parc, const char
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +a %s",
me.name, chptr->chname, source_p->name);
} else if(*parv[1] == '@') {
}
else if(*parv[1] == '@')
{
add_user_to_channel(chptr, source_p, CHFL_CHANOP);
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
":%s SJOIN %ld %s + :@%s",
@ -125,7 +134,9 @@ mo_ojoin(struct Client *client_p, struct Client *source_p, int parc, const char
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +o %s",
me.name, chptr->chname, source_p->name);
} else if(*parv[1] == '%' && ConfigChannel.use_halfop) {
}
else if(*parv[1] == '%' && ConfigChannel.use_halfop)
{
add_user_to_channel(chptr, source_p, CHFL_HALFOP);
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
":%s SJOIN %ld %s + :%s%s",
@ -135,7 +146,9 @@ mo_ojoin(struct Client *client_p, struct Client *source_p, int parc, const char
source_p->username, source_p->host, chptr->chname);
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +h %s",
me.name, chptr->chname, source_p->name);
} else if(*parv[1] == '+') {
}
else if(*parv[1] == '+')
{
add_user_to_channel(chptr, source_p, CHFL_VOICE);
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
":%s SJOIN %ld %s + :+%s",
@ -145,7 +158,9 @@ mo_ojoin(struct Client *client_p, struct Client *source_p, int parc, const char
source_p->username, source_p->host, chptr->chname);
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +v %s",
me.name, chptr->chname, source_p->name);
} else {
}
else
{
add_user_to_channel(chptr, source_p, CHFL_PEON);
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
":%s JOIN %ld %s +",
@ -156,7 +171,8 @@ mo_ojoin(struct Client *client_p, struct Client *source_p, int parc, const char
}
/* send the topic... */
if(chptr->topic != NULL) {
if(chptr->topic != NULL)
{
sendto_one(source_p, form_str(RPL_TOPIC), me.name,
source_p->name, chptr->chname, chptr->topic);
sendto_one(source_p, form_str(RPL_TOPICWHOTIME), me.name,

View File

@ -70,7 +70,8 @@ mo_okick(struct Client *client_p, struct Client *source_p, int parc, const char
char text[10];
static char buf[BUFSIZE];
if(*parv[2] == '\0') {
if(*parv[2] == '\0')
{
sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "KICK");
return 0;
}
@ -89,7 +90,8 @@ mo_okick(struct Client *client_p, struct Client *source_p, int parc, const char
name = LOCAL_COPY(parv[1]);
chptr = find_channel(name);
if(!chptr) {
if(!chptr)
{
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL, form_str(ERR_NOSUCHCHANNEL), name);
return 0;
}
@ -98,16 +100,19 @@ mo_okick(struct Client *client_p, struct Client *source_p, int parc, const char
if((p = strchr(parv[2], ',')))
*p = '\0';
user = LOCAL_COPY(parv[2]); // strtoken(&p2, parv[2], ",");
if(!(who = find_chasing(source_p, user, &chasing))) {
if(!(who = find_chasing(source_p, user, &chasing)))
{
return 0;
}
if((target_p = find_client(user)) == NULL) {
if((target_p = find_client(user)) == NULL)
{
sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, source_p->name, user);
return 0;
}
if((msptr = find_channel_membership(chptr, target_p)) == NULL) {
if((msptr = find_channel_membership(chptr, target_p)) == NULL)
{
sendto_one(source_p, form_str(ERR_USERNOTINCHANNEL),
me.name, source_p->name, parv[1], parv[2]);
return 0;
@ -132,7 +137,7 @@ mo_okick(struct Client *client_p, struct Client *source_p, int parc, const char
":%s KICK %s %s :%s", me.id, chptr->chname, who->id, comment);
remove_user_from_channel(msptr);
snprintf(text, sizeof(text), "K%s", who->id);
rb_snprintf(text, sizeof(text), "K%s", who->id);
/* we don't need to track NOREJOIN stuff unless it's our client being kicked */
if(MyClient(who) && chptr->mode.mode & MODE_NOREJOIN)

View File

@ -66,7 +66,8 @@ static void list_named_channel(struct Client *source_p, const char *name);
static int
mo_olist(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
if(!IsOperSpy(source_p)) {
if(!IsOperSpy(source_p))
{
sendto_one(source_p, form_str(ERR_NOPRIVS),
me.name, source_p->name, "oper_spy");
sendto_one(source_p, form_str(RPL_LISTEND),
@ -100,7 +101,8 @@ list_all_channels(struct Client *source_p)
report_operspy(source_p, "LIST", NULL);
sendto_one(source_p, form_str(RPL_LISTSTART), me.name, source_p->name);
RB_DLINK_FOREACH(ptr, global_channel_list.head) {
RB_DLINK_FOREACH(ptr, global_channel_list.head)
{
chptr = ptr->data;
sendto_one(source_p, ":%s 322 %s %s %lu :[%s] %s",

View File

@ -66,13 +66,15 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
int wasonchannel;
/* admins only */
if(!IsOperAdmin(source_p)) {
if(!IsOperAdmin(source_p))
{
sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "admin");
return 0;
}
/* Now, try to find the channel in question */
if(!IsChanPrefix(parv[1][0]) || !check_channel_name(parv[1])) {
if(!IsChanPrefix(parv[1][0]) || !check_channel_name(parv[1]))
{
sendto_one_numeric(source_p, ERR_BADCHANNAME,
form_str(ERR_BADCHANNAME), parv[1]);
return 0;
@ -80,7 +82,8 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
chptr = find_channel(parv[1]);
if(chptr == NULL) {
if(chptr == NULL)
{
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
form_str(ERR_NOSUCHCHANNEL), parv[1]);
return 0;
@ -90,13 +93,15 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
msptr = find_channel_membership(chptr, source_p);
wasonchannel = msptr != NULL;
if (is_any_op(msptr)) {
if (is_any_op(msptr))
{
sendto_one_notice(source_p, ":Use a normal MODE you idiot");
return 0;
}
params[0] = '\0';
for (i = 2; i < parc; i++) {
for (i = 2; i < parc; i++)
{
if (i != 2)
rb_strlcat(params, " ", sizeof params);
rb_strlcat(params, parv[i], sizeof params);
@ -118,9 +123,11 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
set_channel_mode(client_p, source_p->servptr, chptr, msptr,
parc - 2, parv + 2);
#else
if (parc == 4 && !strcmp(parv[2], "+y") && !irccmp(parv[3], source_p->name)) {
if (parc == 4 && !strcmp(parv[2], "+y") && !irccmp(parv[3], source_p->name))
{
/* Ownering themselves */
if (!wasonchannel) {
if (!wasonchannel)
{
sendto_one_numeric(source_p, ERR_USERNOTINCHANNEL,
form_str(ERR_USERNOTINCHANNEL), parv[3], chptr->chname);
return 0;
@ -132,9 +139,12 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
me.id, (long) chptr->channelts, parv[1],
source_p->id);
msptr->flags |= CHFL_OWNER;
} else if (parc == 4 && !strcmp(parv[2], "+a") && !irccmp(parv[3], source_p->name)) {
}
else if (parc == 4 && !strcmp(parv[2], "+a") && !irccmp(parv[3], source_p->name))
{
/* Admining themselves */
if (!wasonchannel) {
if (!wasonchannel)
{
sendto_one_numeric(source_p, ERR_USERNOTINCHANNEL,
form_str(ERR_USERNOTINCHANNEL), parv[3], chptr->chname);
return 0;
@ -146,9 +156,12 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
me.id, (long) chptr->channelts, parv[1],
source_p->id);
msptr->flags |= CHFL_ADMIN;
} else if (parc == 4 && !strcmp(parv[2], "+o") && !irccmp(parv[3], source_p->name)) {
}
else if (parc == 4 && !strcmp(parv[2], "+o") && !irccmp(parv[3], source_p->name))
{
/* Opping themselves */
if (!wasonchannel) {
if (!wasonchannel)
{
sendto_one_numeric(source_p, ERR_USERNOTINCHANNEL,
form_str(ERR_USERNOTINCHANNEL), parv[3], chptr->chname);
return 0;
@ -160,9 +173,12 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
me.id, (long) chptr->channelts, parv[1],
source_p->id);
msptr->flags |= CHFL_CHANOP;
} else if (parc == 4 && !strcmp(parv[2], "+h") && !irccmp(parv[3], source_p->name)) {
}
else if (parc == 4 && !strcmp(parv[2], "+h") && !irccmp(parv[3], source_p->name))
{
/* Halfopping themselves */
if (!wasonchannel) {
if (!wasonchannel)
{
sendto_one_numeric(source_p, ERR_USERNOTINCHANNEL,
form_str(ERR_USERNOTINCHANNEL), parv[3], chptr->chname);
return 0;
@ -174,14 +190,17 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
me.id, (long) chptr->channelts, parv[1],
source_p->id);
msptr->flags |= CHFL_HALFOP;
} else if (ConfigChannel.use_owner) {
}
else if (ConfigChannel.use_owner)
{
/* I hope this is correct.
* -- Kabaka */
/* Hack it so set_channel_mode() will accept */
if (wasonchannel)
msptr->flags |= CHFL_OWNER;
else {
else
{
add_user_to_channel(chptr, source_p, CHFL_CHANOP);
msptr = find_channel_membership(chptr, source_p);
}
@ -191,11 +210,14 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
msptr->flags &= ~CHFL_OWNER;
else
remove_user_from_channel(msptr);
} else if (ConfigChannel.use_admin) {
}
else if (ConfigChannel.use_admin)
{
/* Hack it so set_channel_mode() will accept */
if (wasonchannel)
msptr->flags |= CHFL_ADMIN;
else {
else
{
add_user_to_channel(chptr, source_p, CHFL_CHANOP);
msptr = find_channel_membership(chptr, source_p);
}
@ -208,12 +230,15 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
msptr->flags &= ~CHFL_ADMIN;
else
remove_user_from_channel(msptr);
} else {
}
else
{
/* CHFL_ADMIN is only useful if admin is enabled
* so hack it with op if it is not. */
if (wasonchannel)
msptr->flags |= CHFL_CHANOP;
else {
else
{
add_user_to_channel(chptr, source_p, CHFL_CHANOP);
msptr = find_channel_membership(chptr, source_p);
}

View File

@ -58,21 +58,25 @@ mo_opme(struct Client *client_p, struct Client *source_p, int parc, const char *
rb_dlink_node *ptr;
/* admins only */
if(!IsOperAdmin(source_p)) {
if(!IsOperAdmin(source_p))
{
sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "admin");
return 0;
}
if((chptr = find_channel(parv[1])) == NULL) {
if((chptr = find_channel(parv[1])) == NULL)
{
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
form_str(ERR_NOSUCHCHANNEL), parv[1]);
return 0;
}
RB_DLINK_FOREACH(ptr, chptr->members.head) {
RB_DLINK_FOREACH(ptr, chptr->members.head)
{
msptr = ptr->data;
if(is_chanop(msptr) || is_admin(msptr) || is_owner(msptr)) {
if(is_chanop(msptr) || is_admin(msptr) || is_owner(msptr))
{
sendto_one_notice(source_p, ":%s Channel is not opless", parv[1]);
return 0;
}
@ -92,7 +96,8 @@ mo_opme(struct Client *client_p, struct Client *source_p, int parc, const char *
parv[1], get_oper_name(source_p));
/* dont send stuff for local channels remotely. */
if(*chptr->chname != '&') {
if(*chptr->chname != '&')
{
sendto_server(NULL, NULL, NOCAPS, NOCAPS,
":%s WALLOPS :OPME called for [%s] by %s!%s@%s",
me.name, parv[1], source_p->name, source_p->username, source_p->host);

View File

@ -139,23 +139,27 @@ m_displaymsg(struct Client *source_p, const char *channel, int underline, int ac
char *nick3 = rb_strdup(nick);
char text2[BUFSIZE];
if((chptr = find_channel(channel)) == NULL) {
if((chptr = find_channel(channel)) == NULL)
{
sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), channel);
return 0;
}
if(!(msptr = find_channel_membership(chptr, source_p))) {
if(!(msptr = find_channel_membership(chptr, source_p)))
{
sendto_one_numeric(source_p, ERR_NOTONCHANNEL,
form_str(ERR_NOTONCHANNEL), chptr->chname);
return 0;
}
if(!(chptr->mode.mode & chmode_flags['N'])) {
if(!(chptr->mode.mode & chmode_flags['N']))
{
sendto_one_numeric(source_p, 573, "%s :Roleplay commands are not enabled on this channel.", chptr->chname);
return 0;
}
if(!can_send(chptr, source_p, msptr)) {
if(!can_send(chptr, source_p, msptr))
{
sendto_one_numeric(source_p, 573, "%s :Cannot send to channel.", chptr->chname);
return 0;
}
@ -165,30 +169,32 @@ m_displaymsg(struct Client *source_p, const char *channel, int underline, int ac
return 0;
/* enforce target change on roleplay commands */
if(!is_chanop_voiced(msptr) && !IsOper(source_p) && !add_channel_target(source_p, chptr)) {
if(!is_chanop_voiced(msptr) && !IsOper(source_p) && !add_channel_target(source_p, chptr))
{
sendto_one(source_p, form_str(ERR_TARGCHANGE),
me.name, source_p->name, chptr->chname);
return 0;
}
if(underline)
snprintf(nick2, sizeof(nick2), "\x1F%s\x1F", strip_unprintable(nick3));
rb_snprintf(nick2, sizeof(nick2), "\x1F%s\x1F", strip_unprintable(nick3));
else
snprintf(nick2, sizeof(nick2), "%s", strip_unprintable(nick3));
rb_snprintf(nick2, sizeof(nick2), "%s", strip_unprintable(nick3));
/* don't allow nicks to be empty after stripping
* this prevents nastiness like fake factions, etc. */
if(EmptyString(nick3)) {
if(EmptyString(nick3))
{
sendto_one_numeric(source_p, 573, "%s :No visible non-stripped characters in nick.", chptr->chname);
return 0;
}
if(action)
snprintf(text2, sizeof(text2), "\1ACTION %s\1", text);
rb_snprintf(text2, sizeof(text2), "\1ACTION %s\1", text);
else
snprintf(text2, sizeof(text2), "%s", text);
rb_snprintf(text2, sizeof(text2), "%s", text);
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@npc.fakeuser.invalid PRIVMSG %s :%s (%s)", nick2, source_p->name, channel, text2, source_p->name);
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@npc.fakeuser.invalid PRIVMSG %s :%s", nick2, source_p->name, channel, text2);
sendto_match_servs(source_p, "*", CAP_ENCAP, NOCAPS, "ENCAP * ROLEPLAY %s %s :%s",
channel, nick2, text2);
return 0;
@ -204,6 +210,6 @@ me_roleplay(struct Client *client_p, struct Client *source_p, int parc, const ch
if((chptr = find_channel(parv[1])) == NULL)
return 0;
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@npc.fakeuser.invalid PRIVMSG %s :%s (%s)", parv[2], source_p->name, parv[1], parv[3], source_p->name);
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@npc.fakeuser.invalid PRIVMSG %s :%s", parv[2], source_p->name, parv[1], parv[3]);
return 0;
}

View File

@ -69,7 +69,8 @@ static const char *expand_xline(const char *mask)
return NULL;
p = mask;
q = buf;
while (*p != '\0') {
while (*p != '\0')
{
if (*p == ' ')
*q++ = '\\', *q++ = 's';
else
@ -88,17 +89,20 @@ static int mo_sendbans(struct Client *client_p, struct Client *source_p, int par
const char *target, *mask2;
struct Client *server_p;
if (!IsOperRemoteBan(source_p)) {
if (!IsOperRemoteBan(source_p))
{
sendto_one(source_p, form_str(ERR_NOPRIVS),
me.name, source_p->name, "remoteban");
return 0;
}
if (!IsOperXline(source_p)) {
if (!IsOperXline(source_p))
{
sendto_one(source_p, form_str(ERR_NOPRIVS),
me.name, source_p->name, "xline");
return 0;
}
if (!IsOperResv(source_p)) {
if (!IsOperResv(source_p))
{
sendto_one(source_p, form_str(ERR_NOPRIVS),
me.name, source_p->name, "resv");
return 0;
@ -106,14 +110,16 @@ static int mo_sendbans(struct Client *client_p, struct Client *source_p, int par
target = parv[1];
count = 0;
RB_DLINK_FOREACH(ptr, global_serv_list.head) {
RB_DLINK_FOREACH(ptr, global_serv_list.head)
{
server_p = ptr->data;
if (IsMe(server_p))
continue;
if (match(target, server_p->name))
count++;
}
if (count == 0) {
if (count == 0)
{
sendto_one_numeric(source_p, ERR_NOSUCHSERVER,
form_str(ERR_NOSUCHSERVER), target);
return 0;
@ -124,7 +130,8 @@ static int mo_sendbans(struct Client *client_p, struct Client *source_p, int par
source_p->name, source_p->username, source_p->host,
target);
RB_DLINK_FOREACH(ptr, resv_conf_list.head) {
RB_DLINK_FOREACH(ptr, resv_conf_list.head)
{
aconf = ptr->data;
if (aconf->hold)
continue;
@ -134,7 +141,8 @@ static int mo_sendbans(struct Client *client_p, struct Client *source_p, int par
target, aconf->host, aconf->passwd);
}
HASH_WALK(i, R_MAX, ptr, resvTable) {
HASH_WALK(i, R_MAX, ptr, resvTable)
{
aconf = ptr->data;
if (aconf->hold)
continue;
@ -145,12 +153,14 @@ static int mo_sendbans(struct Client *client_p, struct Client *source_p, int par
}
HASH_WALK_END
RB_DLINK_FOREACH(ptr, xline_conf_list.head) {
RB_DLINK_FOREACH(ptr, xline_conf_list.head)
{
aconf = ptr->data;
if (aconf->hold)
continue;
mask2 = expand_xline(aconf->host);
if (mask2 == NULL) {
if (mask2 == NULL)
{
sendto_one_notice(source_p, ":Skipping xline [%s]",
aconf->host);
continue;

View File

@ -77,7 +77,8 @@ mr_webirc(struct Client *client_p, struct Client *source_p, int parc, const char
struct ConfItem *aconf;
const char *encr;
if (!strchr(parv[4], '.') && !strchr(parv[4], ':')) {
if (!strchr(parv[4], '.') && !strchr(parv[4], ':'))
{
sendto_one(source_p, "NOTICE * :Invalid IP");
return 0;
}
@ -89,12 +90,14 @@ mr_webirc(struct Client *client_p, struct Client *source_p, int parc, const char
client_p->localClient->ip.ss_family, NULL);
if (aconf == NULL || !(aconf->status & CONF_CLIENT))
return 0;
if (!IsConfDoSpoofIp(aconf) || irccmp(aconf->info.name, "webirc.")) {
if (!IsConfDoSpoofIp(aconf) || irccmp(aconf->info.name, "webirc."))
{
/* XXX */
sendto_one(source_p, "NOTICE * :Not a CGI:IRC auth block");
return 0;
}
if (EmptyString(aconf->passwd)) {
if (EmptyString(aconf->passwd))
{
sendto_one(source_p, "NOTICE * :CGI:IRC auth blocks must have a password");
return 0;
}
@ -106,7 +109,8 @@ mr_webirc(struct Client *client_p, struct Client *source_p, int parc, const char
else
encr = parv[1];
if (strcmp(encr, aconf->passwd)) {
if (strcmp(encr, aconf->passwd))
{
sendto_one(source_p, "NOTICE * :CGI:IRC password incorrect");
return 0;
}
@ -123,8 +127,10 @@ mr_webirc(struct Client *client_p, struct Client *source_p, int parc, const char
/* Check dlines now, klines will be checked on registration */
if((aconf = find_dline((struct sockaddr *)&source_p->localClient->ip,
source_p->localClient->ip.ss_family))) {
if(!(aconf->status & CONF_EXEMPTDLINE)) {
source_p->localClient->ip.ss_family)))
{
if(!(aconf->status & CONF_EXEMPTDLINE))
{
exit_client(client_p, source_p, &me, "D-lined");
return 0;
}

View File

@ -26,7 +26,8 @@ h_nl_umode_changed(hook_data_umode_changed *hdata)
{
struct Client *source_p = hdata->client;
if (MyClient(source_p) && source_p->umodes & UMODE_LOCOPS) {
if (MyClient(source_p) && source_p->umodes & UMODE_LOCOPS)
{
source_p->umodes &= ~UMODE_LOCOPS;
}
}

View File

@ -29,7 +29,8 @@ h_noi_umode_changed(hook_data_umode_changed *hdata)
struct Client *source_p = hdata->client;
if (MyClient(source_p) && IsOper(source_p) && !IsOperInvis(source_p) &&
IsInvisible(source_p)) {
IsInvisible(source_p))
{
ClearInvisible(source_p);
/* If they tried /umode +i, complain; do not complain
* if they opered up while invisible -- jilles */

View File

@ -34,20 +34,27 @@ h_gla_client_exit(hook_data_client_exit *hdata)
if (MyConnect(source_p) || !IsClient(source_p))
return;
if (!strcmp(hdata->comment, "Bad user info")) {
if (!strcmp(hdata->comment, "Bad user info"))
{
sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
"XLINE active for %s[%s@%s]",
source_p->name, source_p->username, source_p->host);
} else if (ConfigFileEntry.kline_reason != NULL &&
!strcmp(hdata->comment, ConfigFileEntry.kline_reason)) {
}
else if (ConfigFileEntry.kline_reason != NULL &&
!strcmp(hdata->comment, ConfigFileEntry.kline_reason))
{
sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
"K/DLINE active for %s[%s@%s]",
source_p->name, source_p->username, source_p->host);
} else if (!strncmp(hdata->comment, "Temporary K-line ", 17)) {
}
else if (!strncmp(hdata->comment, "Temporary K-line ", 17))
{
sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
"K/DLINE active for %s[%s@%s]",
source_p->name, source_p->username, source_p->host);
} else if (!strncmp(hdata->comment, "Temporary D-line ", 17)) {
}
else if (!strncmp(hdata->comment, "Temporary D-line ", 17))
{
sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
"K/DLINE active for %s[%s@%s]",
source_p->name, source_p->username, source_p->host);

View File

@ -52,7 +52,8 @@ show_whois(hook_data_client *data)
IsOper(target_p) &&
#endif
(source_p != target_p) &&
(target_p->snomask & snomask_modes['W'])) {
(target_p->snomask & snomask_modes['W']))
{
sendto_one_notice(target_p,
":*** Notice -- %s (%s@%s) is doing a whois on you [%s]",
source_p->name,

View File

@ -41,7 +41,8 @@ show_stats(hook_data_int *data)
{
char statchar = (char) data->arg2;
if(statchar == 'L' || statchar == 'l') {
if(statchar == 'L' || statchar == 'l')
{
const char *name = data->arg1;
if(!EmptyString(name))
@ -57,7 +58,9 @@ show_stats(hook_data_int *data)
statchar, data->client->name,
data->client->username,
data->client->host, data->client->servptr->name);
} else {
}
else
{
sendto_realops_snomask(SNO_SPY, L_ALL,
"STATS %c requested by %s (%s@%s) [%s]",
statchar, data->client->name, data->client->username,

View File

@ -1,3 +0,0 @@
#!/bin/sh
setuser ircd /home/ircd/run/bin/ircd -foreground

File diff suppressed because it is too large Load Diff

View File

@ -1,414 +0,0 @@
/* Elemental-IRCd functions
*
* (C) 2014 Sam Dodrill <shadowh511@gmail.com>
* (C) 2003-2014 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
#include "module.h"
#include "modules/cs_mode.h"
#include "modules/sasl.h"
static Anope::string UplinkSID;
static ServiceReference<IRCDProto> ratbox("IRCDProto", "ratbox");
class ChannelModeLargeBan : public ChannelMode
{
public:
ChannelModeLargeBan(const Anope::string &mname, char modeChar) : ChannelMode(mname, modeChar) { }
bool CanSet(User *u) const anope_override
{
return u && u->HasMode("OPER");
}
};
class ElementalProto : public IRCDProto
{
public:
ElementalProto(Module *creator) : IRCDProto(creator, "Elemental-IRCd 6.5+")
{
DefaultPseudoclientModes = "+oiS";
CanCertFP = true;
CanSNLine = true;
CanSQLine = true;
CanSZLine = true;
CanSVSNick = true;
CanSVSHold = true;
CanSetVHost = true;
RequiresID = true;
MaxModes = 4;
}
void SendSVSKillInternal(const MessageSource &source, User *targ, const Anope::string &reason) anope_override { ratbox->SendSVSKillInternal(source, targ, reason); }
void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override { ratbox->SendGlobalNotice(bi, dest, msg); }
void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override { ratbox->SendGlobalPrivmsg(bi, dest, msg); }
void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) anope_override { ratbox->SendGlobopsInternal(source, buf); }
void SendSGLine(User *u, const XLine *x) anope_override { ratbox->SendSGLine(u, x); }
void SendSGLineDel(const XLine *x) anope_override { ratbox->SendSGLineDel(x); }
void SendAkill(User *u, XLine *x) anope_override { ratbox->SendAkill(u, x); }
void SendAkillDel(const XLine *x) anope_override { ratbox->SendAkillDel(x); }
void SendSQLineDel(const XLine *x) anope_override { ratbox->SendSQLineDel(x); }
void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override { ratbox->SendJoin(user, c, status); }
void SendServer(const Server *server) anope_override { ratbox->SendServer(server); }
void SendChannel(Channel *c) anope_override { ratbox->SendChannel(c); }
void SendTopic(const MessageSource &source, Channel *c) anope_override { ratbox->SendTopic(source, c); }
bool IsIdentValid(const Anope::string &ident) anope_override { return ratbox->IsIdentValid(ident); }
void SendLogin(User *u, NickAlias *na) anope_override { ratbox->SendLogin(u, na); }
void SendLogout(User *u) anope_override { ratbox->SendLogout(u); }
void SendSQLine(User *, const XLine *x) anope_override
{
UplinkSocket::Message(Me) << "RESV * " << x->mask << " :" << x->GetReason();
}
void SendConnect() anope_override
{
UplinkSocket::Message() << "PASS " << Config->Uplinks[Anope::CurrentUplink].password << " TS 6 :" << Me->GetSID();
/*
* Received: CAPAB :BAN CHW CLUSTER ENCAP EOPMOD EUID EX IE KLN
* KNOCK MLOCK QS RSFNC SAVE SERVICES TB UNKLN
*
* BAN - Can do BAN message
* CHW - Can do channel wall @#
* CLUSTER - Supports umode +l, can send LOCOPS (encap only)
* ENCAP - Can do ENCAP message
* EOPMOD - Can do channel wall =# (for cmode +z)
* EUID - Can do EUID (its similar to UID but includes the ENCAP REALHOST and ENCAP LOGIN information)
* EX - Can do channel +e exemptions
* GLN - Can set G:Lines
* IE - Can do invite exceptions
* KLN - Can set K:Lines (encap only)
* KNOCK - Supports KNOCK
* MLOCK - Supports MLOCK
* RSFNC - Forces a nickname change and propagates it (encap only)
* SERVICES - Support channel mode +r (only registered users may join)
* SAVE - Resolve a nick collision by changing a nickname to the UID.
* TB - Supports topic burst
* UNKLN - Can do UNKLINE (encap only)
* QS - Can handle quit storm removal
*/
UplinkSocket::Message() << "CAPAB :BAN CHW CLUSTER ENCAP EOPMOD EUID EX IE KLN KNOCK MLOCK QS RSFNC SERVICES TB UNKLN";
/* Make myself known to myself in the serverlist */
SendServer(Me);
/*
* Received: SVINFO 6 6 0 :1353235537
* arg[0] = current TS version
* arg[1] = minimum required TS version
* arg[2] = '0'
* arg[3] = server's idea of UTC time
*/
UplinkSocket::Message() << "SVINFO 6 6 0 :" << Anope::CurTime;
}
void SendClientIntroduction(User *u) anope_override
{
Anope::string modes = "+" + u->GetModes();
UplinkSocket::Message(Me) << "EUID " << u->nick << " 1 " << u->timestamp << " " << modes << " " << u->GetIdent() << " " << u->host << " 0 " << u->GetUID() << " * * :" << u->realname;
}
void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) anope_override
{
UplinkSocket::Message(Me) << "ENCAP " << u->server->GetName() << " RSFNC " << u->GetUID()
<< " " << newnick << " " << when << " " << u->timestamp;
}
void SendSVSHold(const Anope::string &nick, time_t delay) anope_override
{
UplinkSocket::Message(Me) << "ENCAP * NICKDELAY " << delay << " " << nick;
}
void SendSVSHoldDel(const Anope::string &nick) anope_override
{
UplinkSocket::Message(Me) << "ENCAP * NICKDELAY 0 " << nick;
}
void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) anope_override
{
UplinkSocket::Message(Me) << "ENCAP * CHGHOST " << u->GetUID() << " :" << host;
}
void SendVhostDel(User *u) anope_override
{
this->SendVhost(u, "", u->host);
}
void SendSASLMessage(const SASL::Message &message) anope_override
{
Server *s = Server::Find(message.target.substr(0, 3));
UplinkSocket::Message(Me) << "ENCAP " << (s ? s->GetName() : message.target.substr(0, 3)) << " SASL " << message.source << " " << message.target << " " << message.type << " " << message.data << (message.ext.empty() ? "" : (" " + message.ext));
}
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) anope_override
{
Server *s = Server::Find(uid.substr(0, 3));
UplinkSocket::Message(Me) << "ENCAP " << (s ? s->GetName() : uid.substr(0, 3)) << " SVSLOGIN " << uid << " * * * " << acc;
}
};
struct IRCDMessageEncap : IRCDMessage
{
IRCDMessageEncap(Module *creator) : IRCDMessage(creator, "ENCAP", 3) { SetFlag(IRCDMESSAGE_SOFT_LIMIT);}
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
User *u = source.GetUser();
// In a burst, states that the source user is logged in as the account.
if (params[1] == "LOGIN" || params[1] == "SU")
{
NickCore *nc = NickCore::Find(params[2]);
if (!nc)
return;
u->Login(nc);
}
// Received: :42XAAAAAE ENCAP * CERTFP :3f122a9cc7811dbad3566bf2cec3009007c0868f
if (params[1] == "CERTFP")
{
u->fingerprint = params[2];
FOREACH_MOD(OnFingerprint, (u));
}
/*
* Received: :42X ENCAP * SASL 42XAAAAAH * S PLAIN
* Received: :42X ENCAP * SASL 42XAAAAAC * D A
*
* Part of a SASL authentication exchange. The mode is 'C' to send some data
* (base64 encoded), or 'S' to end the exchange (data indicates type of
* termination: 'A' for abort, 'F' for authentication failure, 'S' for
* authentication success).
*
* Charybdis only accepts messages from SASL agents; these must have umode +S
*/
if (params[1] == "SASL" && SASL::sasl && params.size() >= 6)
{
SASL::Message m;
m.source = params[2];
m.target = params[3];
m.type = params[4];
m.data = params[5];
m.ext = params.size() > 6 ? params[6] : "";
SASL::sasl->ProcessMessage(m);
}
}
};
struct IRCDMessageEUID : IRCDMessage
{
IRCDMessageEUID(Module *creator) : IRCDMessage(creator, "EUID", 11) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
/*
* :42X EUID DukePyrolator 1 1353240577 +Zi ~jens erft-5d80b00b.pool.mediaWays.net 93.128.176.11 42XAAAAAD * * :jens
* :<SID> EUID <NICK> <HOPS> <TS> +<UMODE> <USERNAME> <VHOST> <IP> <UID> <REALHOST> <ACCOUNT> :<GECOS>
* 0 1 2 3 4 5 6 7 8 9 10
*
* Introduces a user. The hostname field is now always the visible host.
* The realhost field is * if the real host is equal to the visible host.
* The account field is * if the login is not set.
* Note that even if both new fields are *, an EUID command still carries more
* information than a UID command (namely that real host is visible host and the
* user is not logged in with services). Hence a NICK or UID command received
* from a remote server should not be sent in EUID form to other servers.
*/
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
NickAlias *na = NULL;
if (params[9] != "*")
na = NickAlias::Find(params[9]);
User::OnIntroduce(params[0], params[4], params[8], params[5], params[6], source.GetServer(), params[10], params[2].is_pos_number_only() ? convertTo<time_t>(params[2]) : Anope::CurTime, params[3], params[7], na ? *na->nc : NULL);
}
};
// we cant use this function from ratbox because we set a local variable here
struct IRCDMessageServer : IRCDMessage
{
IRCDMessageServer(Module *creator) : IRCDMessage(creator, "SERVER", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
// SERVER dev.anope.de 1 :charybdis test server
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
// Servers other then our immediate uplink are introduced via SID
if (params[1] != "1")
return;
new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], 1, params[2], UplinkSID);
IRCD->SendPing(Me->GetName(), params[0]);
}
};
// we cant use this function from ratbox because we set a local variable here
struct IRCDMessagePass : IRCDMessage
{
IRCDMessagePass(Module *creator) : IRCDMessage(creator, "PASS", 4) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
// UplinkSID is used in IRCDMessageServer
UplinkSID = params[3];
}
};
class ProtoElemental : public Module
{
Module *m_ratbox;
ElementalProto ircd_proto;
/* Core message handlers */
Message::Away message_away;
Message::Capab message_capab;
Message::Error message_error;
Message::Invite message_invite;
Message::Kick message_kick;
Message::Kill message_kill;
Message::Mode message_mode;
Message::MOTD message_motd;
Message::Notice message_notice;
Message::Part message_part;
Message::Ping message_ping;
Message::Privmsg message_privmsg;
Message::Quit message_quit;
Message::SQuit message_squit;
Message::Stats message_stats;
Message::Time message_time;
Message::Topic message_topic;
Message::Version message_version;
Message::Whois message_whois;
/* Ratbox Message Handlers */
ServiceAlias message_bmask, message_join, message_nick, message_pong, message_sid, message_sjoin,
message_tb, message_tmode, message_uid;
/* Our message handlers */
IRCDMessageEncap message_encap;
IRCDMessageEUID message_euid;
IRCDMessagePass message_pass;
IRCDMessageServer message_server;
bool use_server_side_mlock;
void AddModes()
{
ModeManager::AddChannelMode(new ChannelModeStatus("HALFOP", 'h', '%', 1));
ModeManager::AddChannelMode(new ChannelModeStatus("PROTECT", 'a', '!', 3));
ModeManager::AddChannelMode(new ChannelModeStatus("OWNER", 'y', '~', 4));
/* Add user modes */
ModeManager::AddUserMode(new UserMode("NOFORWARD", 'Q'));
ModeManager::AddUserMode(new UserMode("REGPRIV", 'R'));
ModeManager::AddUserMode(new UserModeOperOnly("OPERWALLS", 'z'));
ModeManager::AddUserMode(new UserModeNoone("SSL", 'Z'));
/* b/e/I */
ModeManager::AddChannelMode(new ChannelModeList("QUIET", 'q'));
/* Add channel modes */
ModeManager::AddChannelMode(new ChannelMode("BLOCKCOLOR", 'c'));
ModeManager::AddChannelMode(new ChannelMode("NOCTCP", 'C'));
ModeManager::AddChannelMode(new ChannelModeParam("REDIRECT", 'f'));
ModeManager::AddChannelMode(new ChannelMode("ALLOWFORWARD", 'F'));
ModeManager::AddChannelMode(new ChannelMode("ALLINVITE", 'g'));
ModeManager::AddChannelMode(new ChannelModeParam("JOINFLOOD", 'j'));
ModeManager::AddChannelMode(new ChannelModeLargeBan("LBAN", 'L'));
ModeManager::AddChannelMode(new ChannelMode("PERM", 'P'));
ModeManager::AddChannelMode(new ChannelMode("NOFORWARD", 'Q'));
ModeManager::AddChannelMode(new ChannelMode("OPMODERATED", 'z'));
}
public:
ProtoElemental(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
ircd_proto(this),
message_away(this), message_capab(this), message_error(this), message_invite(this), message_kick(this),
message_kill(this), message_mode(this), message_motd(this), message_notice(this), message_part(this),
message_ping(this), message_privmsg(this), message_quit(this), message_squit(this), message_stats(this),
message_time(this), message_topic(this), message_version(this), message_whois(this),
message_bmask("IRCDMessage", "charybdis/bmask", "ratbox/bmask"),
message_join("IRCDMessage", "charybdis/join", "ratbox/join"),
message_nick("IRCDMessage", "charybdis/nick", "ratbox/nick"),
message_pong("IRCDMessage", "charybdis/pong", "ratbox/pong"),
message_sid("IRCDMessage", "charybdis/sid", "ratbox/sid"),
message_sjoin("IRCDMessage", "charybdis/sjoin", "ratbox/sjoin"),
message_tb("IRCDMessage", "charybdis/tb", "ratbox/tb"),
message_tmode("IRCDMessage", "charybdis/tmode", "ratbox/tmode"),
message_uid("IRCDMessage", "charybdis/uid", "ratbox/uid"),
message_encap(this), message_euid(this), message_pass(this), message_server(this)
{
if (ModuleManager::LoadModule("ratbox", User::Find(creator)) != MOD_ERR_OK)
throw ModuleException("Unable to load ratbox");
m_ratbox = ModuleManager::FindModule("ratbox");
if (!m_ratbox)
throw ModuleException("Unable to find ratbox");
if (!ratbox)
throw ModuleException("No protocol interface for ratbox");
this->AddModes();
}
~ProtoElemental()
{
m_ratbox = ModuleManager::FindModule("ratbox");
ModuleManager::UnloadModule(m_ratbox, NULL);
}
void OnReload(Configuration::Conf *conf) anope_override
{
use_server_side_mlock = conf->GetModule(this)->Get<bool>("use_server_side_mlock");
}
void OnChannelSync(Channel *c) anope_override
{
if (!c->ci)
return;
ModeLocks *modelocks = c->ci->GetExt<ModeLocks>("modelocks");
if (use_server_side_mlock && modelocks && Servers::Capab.count("MLOCK") > 0)
{
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "");
UplinkSocket::Message(Me) << "MLOCK " << static_cast<long>(c->creation_time) << " " << c->ci->name << " " << modes;
}
}
EventReturn OnMLock(ChannelInfo *ci, ModeLock *lock) anope_override
{
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
if (use_server_side_mlock && cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
{
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "") + cm->mchar;
UplinkSocket::Message(Me) << "MLOCK " << static_cast<long>(ci->c->creation_time) << " " << ci->name << " " << modes;
}
return EVENT_CONTINUE;
}
EventReturn OnUnMLock(ChannelInfo *ci, ModeLock *lock) anope_override
{
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
if (use_server_side_mlock && cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
{
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "").replace_all_cs(cm->mchar, "");
UplinkSocket::Message(Me) << "MLOCK " << static_cast<long>(ci->c->creation_time) << " " << ci->name << " " << modes;
}
return EVENT_CONTINUE;
}
};
MODULE_INIT(ProtoElemental)

View File

@ -1,125 +0,0 @@
/*
* Copyright (c) 2003-2004 E. Will et al.
* Copyright (c) 2005-2008 Atheme Development Group
* Copyright (c) 2008-2010 ShadowIRCd Development Group
* Copyright (c) 2013 PonyChat Development Group
* Rights to this code are documented in doc/LICENSE.
*
* This file contains protocol support for ponychat-ircd.
*
*/
#include "atheme.h"
#include "uplink.h"
#include "pmodule.h"
#include "protocol/shadowircd.h"
DECLARE_MODULE_V1("protocol/elemental-ircd", true, _modinit, NULL, PACKAGE_STRING, "PonyChat Development Group <http://www.ponychat.net>");
/* *INDENT-OFF* */
ircd_t elemental_ircd = {
"elemental-ircd", /* IRCd name */
"$$", /* TLD Prefix, used by Global. */
true, /* Whether or not we use IRCNet/TS6 UID */
false, /* Whether or not we use RCOMMAND */
true, /* Whether or not we support channel owners. */
true, /* Whether or not we support channel protection. */
true, /* Whether or not we support halfops. */
false, /* Whether or not we use P10 */
false, /* Whether or not we use vHosts. */
CMODE_EXLIMIT | CMODE_PERM | CMODE_IMMUNE, /* Oper-only cmodes */
CSTATUS_OWNER, /* Integer flag for owner channel flag. */
CSTATUS_PROTECT, /* Integer flag for protect channel flag. */
CSTATUS_HALFOP, /* Integer flag for halfops. */
"+y", /* Mode we set for owner. */
"+a", /* Mode we set for protect. */
"+h", /* Mode we set for halfops. */
PROTOCOL_SHADOWIRCD, /* Protocol type */
CMODE_PERM, /* Permanent cmodes */
CMODE_IMMUNE, /* Oper-immune cmode */
"beIq", /* Ban-like cmodes */
'e', /* Except mchar */
'I', /* Invex mchar */
IRCD_CIDR_BANS | IRCD_HOLDNICK /* Flags */
};
struct cmode_ elemental_mode_list[] = {
{ 'i', CMODE_INVITE },
{ 'm', CMODE_MOD },
{ 'n', CMODE_NOEXT },
{ 'p', CMODE_PRIV },
{ 's', CMODE_SEC },
{ 't', CMODE_TOPIC },
{ 'c', CMODE_NOCOLOR},
{ 'r', CMODE_REGONLY},
{ 'z', CMODE_OPMOD },
{ 'g', CMODE_FINVITE},
{ 'L', CMODE_EXLIMIT},
{ 'P', CMODE_PERM },
{ 'F', CMODE_FTARGET},
{ 'Q', CMODE_DISFWD },
{ 'M', CMODE_IMMUNE },
{ 'C', CMODE_NOCTCP },
{ 'A', CMODE_ADMINONLY },
{ 'O', CMODE_OPERONLY },
{ 'S', CMODE_SSLONLY },
{ 'D', CMODE_NOACTIONS },
{ 'T', CMODE_NONOTICE },
{ 'G', CMODE_NOCAPS },
{ 'E', CMODE_NOKICKS },
{ 'd', CMODE_NONICKS },
{ 'K', CMODE_NOREPEAT },
{ 'J', CMODE_KICKNOREJOIN },
{ '\0', 0 }
};
struct cmode_ elemental_status_mode_list[] = {
{ 'y', CSTATUS_OWNER },
{ 'a', CSTATUS_PROTECT },
{ 'o', CSTATUS_OP },
{ 'h', CSTATUS_HALFOP },
{ 'v', CSTATUS_VOICE },
{ '\0', 0 }
};
struct cmode_ elemental_prefix_mode_list[] = {
{ '~', CSTATUS_OWNER },
{ '!', CSTATUS_PROTECT },
{ '@', CSTATUS_OP },
{ '%', CSTATUS_HALFOP },
{ '+', CSTATUS_VOICE },
{ '\0', 0 }
};
struct cmode_ elemental_user_mode_list[] = {
{ 'a', UF_ADMIN },
{ 'i', UF_INVIS },
{ 'o', UF_IRCOP },
{ 'D', UF_DEAF },
{ '\0', 0 }
};
/* *INDENT-ON* */
void _modinit(module_t * m)
{
MODULE_TRY_REQUEST_DEPENDENCY(m, "protocol/charybdis");
mode_list = elemental_mode_list;
user_mode_list = elemental_user_mode_list;
status_mode_list = elemental_status_mode_list;
prefix_mode_list = elemental_prefix_mode_list;
ircd = &elemental_ircd;
m->mflags = MODTYPE_CORE;
pmodule_loaded = true;
}
/* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs
* vim:ts=8
* vim:sw=8
* vim:noexpandtab
*/

View File

@ -26,8 +26,6 @@ NO PARAMETERS:
weakens +i control.
+z - Op moderated. Messages blocked by +m, +b and +q are instead
sent to ops.
+u - Hidden ban/quiet list. Ban/quiet lists may only be seen
by halfops or higher.
* +L - Large ban list. Increase maximum number of +beIq entries.
* +P - Permanent. Channel does not disappear when empty.
+F - Free target. Anyone may set forwards to this (otherwise

View File

@ -16,7 +16,7 @@ $$servermask - Send a message to a server or set of
$#hostmask - Send a message to users matching the
hostmask specified.
These two require Oper Priv: oper:mass_notice
These two are operator only.
The nick can be extended to fit into the following
syntax:

View File

@ -4,4 +4,4 @@ Restarts the IRC server. If a second server name
is provided, remotely restart that server. In this
case, both server names must match.
- Requires Oper Priv: oper:die
- Requires Oper Priv: oper:admin

View File

@ -25,6 +25,4 @@ User modes: (* designates that the umode is oper only)
+G - "soft caller id" mode - same as +g but automatically allows
anyone who's in a common channel with you to message you.
+V - Prevents you from receiving invites.
+I - Prevents non-opers from seeing your channel list in
a whois query.
+Z - Is connected via SSL (set only on connection).

View File

@ -5,4 +5,4 @@ who are umode +w (including non-opers).
Server sent WALLOPS go to all opers who are umode +w.
- Requires Oper Priv: oper:mass_notice
- Requires Oper Priv: oper:operwall

View File

@ -24,8 +24,6 @@ NO PARAMETERS:
change nick.
+g - Free invite. Everyone may invite users. Significantly
weakens +i control.
+u - Hidden ban/quiet lists. Ban/quiet lists are hidden from all
channel members that are not a halfop or higher.
+z - Op moderated. Messages blocked by +m, +b and +q are instead
sent to ops.
* +L - Large ban list. Increase maximum number of +beIq entries.

View File

@ -14,8 +14,6 @@ User modes: (? designates that the umode is provided by an extension
+B - Marks you as a bot in /whois.
+C - Prevents you from receiving CTCPs other than ACTION.
+D - Deaf - ignores all channel messages.
+I - Prevents non-opers from seeing your channel list in
a whois query.
+Q - Prevents you from being affected by channel forwarding.
+R - Prevents non accept unidentified users from messaging you.
+G - "soft caller id" mode - same as +g but automatically allows

View File

@ -3,7 +3,8 @@
void init_bandb(void);
typedef enum {
typedef enum
{
BANDB_KLINE,
BANDB_DLINE,
BANDB_XLINE,

View File

@ -3,8 +3,7 @@
#define HELP_MAX 100
/* Adjusted to allow wider MOTD */
#define CACHELINELEN 513
#define CACHELINELEN 81
#define CACHEFILELEN 30
/* two servernames, a gecos, three spaces, ":1", '\0' */
#define LINKSLINELEN (HOSTLEN + HOSTLEN + REALLEN + 6)
@ -14,13 +13,15 @@
struct Client;
struct cachefile {
struct cachefile
{
char name[CACHEFILELEN];
rb_dlink_list contents;
int flags;
};
struct cacheline {
struct cacheline
{
char data[CACHELINELEN];
rb_dlink_node linenode;
};

View File

@ -35,7 +35,8 @@
struct Client;
/* mode structure for channels */
struct Mode {
struct Mode
{
unsigned int mode;
int limit;
char key[KEYLEN];
@ -45,7 +46,8 @@ struct Mode {
};
/* channel structure */
struct Channel {
struct Channel
{
rb_dlink_node node;
struct Mode mode;
char *mode_lock;
@ -77,7 +79,8 @@ struct Channel {
char *chname;
};
struct membership {
struct membership
{
rb_dlink_node channode;
rb_dlink_node locchannode;
rb_dlink_node usernode;
@ -90,19 +93,22 @@ struct membership {
};
#define BANLEN 195
struct Ban {
struct Ban
{
char *banstr;
char *who;
time_t when;
rb_dlink_node node;
};
struct mode_letter {
struct mode_letter
{
int mode;
char letter;
};
struct ChModeChange {
struct ChModeChange
{
char letter;
const char *arg;
const char *id;
@ -114,7 +120,8 @@ struct ChModeChange {
struct Client *client;
};
struct ChCapCombo {
struct ChCapCombo
{
int count;
int cap_yes;
int cap_no;
@ -124,7 +131,8 @@ typedef void (*ChannelModeFunc)(struct Client *source_p, struct Channel *chptr,
int alevel, int parc, int *parn,
const char **parv, int *errors, int dir, char c, long mode_type);
struct ChannelMode {
struct ChannelMode
{
ChannelModeFunc set_func;
long mode_type;
};
@ -183,7 +191,6 @@ typedef int (*ExtbanFunc)(const char *data, struct Client *client_p,
#define MODE_NOREJOIN 0x200000 /* Block rejoin immediately after kick */
#define MODE_NOREPEAT 0x400000 /* Block repeat messages */
#define MODE_NOOPERKICK 0x800000 /* disallow kicking opers */
#define MODE_HIDEBANS 0x1000000 /* disallow non-chanops from seeing ban/quiet lists */
#define CHFL_BAN 0x10000000 /* ban channel flag */
#define CHFL_EXCEPTION 0x20000000 /* exception to ban channel flag */
@ -302,9 +309,9 @@ extern void user_join(struct Client * client_p, struct Client * source_p, const
extern void do_join_0(struct Client *client_p, struct Client *source_p);
extern int check_channel_name_loc(struct Client *source_p, const char *name);
extern struct Metadata *channel_metadata_add(struct Channel *target, const char *name, const char *value, int propagate);
extern struct Metadata *channel_metadata_add(struct Channel *target, const char *name, const char *value, int propegate);
extern struct Metadata *channel_metadata_time_add(struct Channel *target, const char *name, time_t timevalue, const char *value);
extern void channel_metadata_delete(struct Channel *target, const char *name, int propagate);
extern void channel_metadata_delete(struct Channel *target, const char *name, int propegate);
extern struct Metadata *channel_metadata_find(struct Channel *target, const char *name);
extern void channel_metadata_clear(struct Channel *target);

View File

@ -30,7 +30,8 @@ struct ConfItem;
struct Client;
struct _patricia_tree_t;
struct Class {
struct Class
{
struct Class *next;
char *class_name;
int max_total;

View File

@ -76,7 +76,8 @@ struct scache_entry;
/*
* Client structures
*/
struct User {
struct User
{
rb_dlink_list channel; /* chain of channel pointer blocks */
rb_dlink_list invited; /* chain of invite pointer blocks */
char *away; /* pointer to away message */
@ -87,7 +88,8 @@ struct User {
char suser[NICKLEN+1];
};
struct Server {
struct Server
{
struct User *user; /* who activated this connection */
char by[NICKLEN];
rb_dlink_list servers;
@ -97,7 +99,8 @@ struct Server {
struct scache_entry *nameinfo;
};
struct ZipStats {
struct ZipStats
{
unsigned long long in;
unsigned long long in_wire;
unsigned long long out;
@ -106,7 +109,8 @@ struct ZipStats {
double out_ratio;
};
struct Client {
struct Client
{
rb_dlink_node node;
rb_dlink_node lnode;
struct User *user; /* ...defined, if this is a User */
@ -166,7 +170,8 @@ struct Client {
char *certfp; /* client certificate fingerprint */
};
struct LocalUser {
struct LocalUser
{
rb_dlink_node tnode; /* This is the node for the local list type the client is on*/
/*
* The following fields are allocated only for local clients
@ -281,7 +286,8 @@ struct LocalUser {
struct ev_entry *override_timeout_event;
};
struct PreClient {
struct PreClient
{
char spoofnick[NICKLEN + 1];
char spoofuser[USERLEN + 1];
char spoofhost[HOSTLEN + 1];
@ -296,7 +302,8 @@ struct PreClient {
struct rb_sockaddr_storage lip; /* address of our side of the connection */
};
struct ListClient {
struct ListClient
{
unsigned int hash_indice;
unsigned int users_min, users_max;
time_t created_min, created_max, topic_min, topic_max;
@ -402,6 +409,7 @@ struct ListClient {
#define LFLAGS_SSL 0x00000001
#define LFLAGS_FLUSH 0x00000002
#define LFLAGS_CORK 0x00000004
#define LFLAGS_WEBSOCKET 0x00000008
/* umodes, settable flags */
/* lots of this moved to snomask -- jilles */
@ -419,7 +427,6 @@ struct ListClient {
#define UMODE_NOINVITE 0x0800 /* block invites */
#define UMODE_BOT 0x8000 /* mark as a bot in whois */
#define UMODE_SCALLERID 0x40000 /* soft caller id */
#define UMODE_HIDECHANS 0x80000 /* hide channels in whois */
/* user information flags, only settable by remote mode or local oper */
#define UMODE_OPER 0x1000 /* Operator */
@ -489,6 +496,10 @@ struct ListClient {
#define SetSSL(x) ((x)->localClient->localflags |= LFLAGS_SSL)
#define ClearSSL(x) ((x)->localClient->localflags &= ~LFLAGS_SSL)
#define IsWebSocket(x) ((x)->localClient->localflags & LFLAGS_WEBSOCKET)
#define SetWebSocket(x) ((x)->localClient->localflags |= LFLAGS_WEBSOCKET)
#define ClearWebSocket(x) ((x)->localClient->localflags &= ~LFLAGS_WEBSOCKET)
#define IsFlush(x) ((x)->localClient->localflags & LFLAGS_FLUSH)
#define SetFlush(x) ((x)->localClient->localflags |= LFLAGS_FLUSH)
#define ClearFlush(x) ((x)->localClient->localflags &= ~LFLAGS_FLUSH)
@ -609,8 +620,8 @@ extern char *generate_uid(void);
void allocate_away(struct Client *);
void free_away(struct Client *);
extern struct Metadata *user_metadata_add(struct Client *target, const char *name, const char *value, int propagate);
extern void user_metadata_delete(struct Client *target, const char *name, int propagate);
extern struct Metadata *user_metadata_add(struct Client *target, const char *name, const char *value, int propegate);
extern void user_metadata_delete(struct Client *target, const char *name, int propegate);
extern struct Metadata *user_metadata_find(struct Client *target, const char *name);
extern void user_metadata_clear(struct Client *target);

View File

@ -6,7 +6,8 @@
#ifndef INCLUDED_HOOK_H
#define INCLUDED_HOOK_H
typedef struct {
typedef struct
{
char *name;
rb_dlink_list hooks;
} hook;
@ -35,55 +36,64 @@ void add_hook(const char *name, hookfn fn);
void remove_hook(const char *name, hookfn fn);
void call_hook(int id, void *arg);
typedef struct {
typedef struct
{
struct Client *client;
const void *arg1;
const void *arg2;
} hook_data;
typedef struct {
typedef struct
{
struct Client *client;
const void *arg1;
int arg2;
} hook_data_int;
typedef struct {
typedef struct
{
struct Client *client;
struct Client *target;
} hook_data_client;
typedef struct {
typedef struct
{
struct Client *client;
struct Channel *chptr;
int approved;
} hook_data_channel;
typedef struct {
typedef struct
{
struct Client *client;
struct Channel *chptr;
char *key;
} hook_data_channel_activity;
typedef struct {
typedef struct
{
struct Client *client;
struct Channel *chptr;
struct Client *target;
int approved;
} hook_data_channel_approval;
typedef struct {
typedef struct
{
struct Client *client;
int approved;
} hook_data_client_approval;
typedef struct {
typedef struct
{
struct Client *local_link; /* local client originating this, or NULL */
struct Client *target; /* dying client */
struct Client *from; /* causing client (could be &me or target) */
const char *comment;
} hook_data_client_exit;
typedef struct {
typedef struct
{
struct Client *client;
unsigned int oldumodes;
unsigned int oldsnomask;

View File

@ -26,7 +26,8 @@
#ifndef INCLUDE_hostmask_h
#define INCLUDE_hostmask_h 1
enum {
enum
{
HM_HOST,
HM_IPV4
#ifdef RB_IPV6
@ -69,12 +70,15 @@ int match_ipv4(struct sockaddr *, struct sockaddr *, int);
extern struct AddressRec *atable[ATABLE_SIZE];
struct AddressRec {
struct AddressRec
{
/* masktype: HM_HOST, HM_IPV4, HM_IPV6 -A1kmm */
int masktype;
union {
struct {
union
{
struct
{
/* Pointer into ConfItem... -A1kmm */
struct rb_sockaddr_storage addr;
int bits;

318
include/http_parser.h Normal file
View File

@ -0,0 +1,318 @@
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#ifndef http_parser_h
#define http_parser_h
#ifdef __cplusplus
extern "C" {
#endif
/* Also update SONAME in the Makefile whenever you change these. */
#define HTTP_PARSER_VERSION_MAJOR 2
#define HTTP_PARSER_VERSION_MINOR 1
#define HTTP_PARSER_VERSION_PATCH 0
#include <sys/types.h>
#if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600)
#include <BaseTsd.h>
#include <stddef.h>
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif
/* Compile with -DHTTP_PARSER_STRICT=0 to make less checks, but run
* faster
*/
#ifndef HTTP_PARSER_STRICT
# define HTTP_PARSER_STRICT 1
#endif
/* Maximium header size allowed */
#define HTTP_MAX_HEADER_SIZE (80*1024)
typedef struct http_parser http_parser;
typedef struct http_parser_settings http_parser_settings;
/* Callbacks should return non-zero to indicate an error. The parser will
* then halt execution.
*
* The one exception is on_headers_complete. In a HTTP_RESPONSE parser
* returning '1' from on_headers_complete will tell the parser that it
* should not expect a body. This is used when receiving a response to a
* HEAD request which may contain 'Content-Length' or 'Transfer-Encoding:
* chunked' headers that indicate the presence of a body.
*
* http_data_cb does not return data chunks. It will be call arbitrarally
* many times for each string. E.G. you might get 10 callbacks for "on_url"
* each providing just a few characters more data.
*/
typedef int (*http_data_cb) (http_parser*, const char *at, size_t length);
typedef int (*http_cb) (http_parser*);
/* Request Methods */
#define HTTP_METHOD_MAP(XX) \
XX(0, DELETE, DELETE) \
XX(1, GET, GET) \
XX(2, HEAD, HEAD) \
XX(3, POST, POST) \
XX(4, PUT, PUT) \
/* pathological */ \
XX(5, CONNECT, CONNECT) \
XX(6, OPTIONS, OPTIONS) \
XX(7, TRACE, TRACE) \
/* webdav */ \
XX(8, COPY, COPY) \
XX(9, LOCK, LOCK) \
XX(10, MKCOL, MKCOL) \
XX(11, MOVE, MOVE) \
XX(12, PROPFIND, PROPFIND) \
XX(13, PROPPATCH, PROPPATCH) \
XX(14, SEARCH, SEARCH) \
XX(15, UNLOCK, UNLOCK) \
/* subversion */ \
XX(16, REPORT, REPORT) \
XX(17, MKACTIVITY, MKACTIVITY) \
XX(18, CHECKOUT, CHECKOUT) \
XX(19, MERGE, MERGE) \
/* upnp */ \
XX(20, MSEARCH, M-SEARCH) \
XX(21, NOTIFY, NOTIFY) \
XX(22, SUBSCRIBE, SUBSCRIBE) \
XX(23, UNSUBSCRIBE, UNSUBSCRIBE) \
/* RFC-5789 */ \
XX(24, PATCH, PATCH) \
XX(25, PURGE, PURGE) \
enum http_method
{
#define XX(num, name, string) HTTP_##name = num,
HTTP_METHOD_MAP(XX)
#undef XX
};
enum http_parser_type { HTTP_REQUEST, HTTP_RESPONSE, HTTP_BOTH };
/* Flag values for http_parser.flags field */
enum flags
{ F_CHUNKED = 1 << 0
, F_CONNECTION_KEEP_ALIVE = 1 << 1
, F_CONNECTION_CLOSE = 1 << 2
, F_TRAILING = 1 << 3
, F_UPGRADE = 1 << 4
, F_SKIPBODY = 1 << 5
};
/* Map for errno-related constants
*
* The provided argument should be a macro that takes 2 arguments.
*/
#define HTTP_ERRNO_MAP(XX) \
/* No error */ \
XX(OK, "success") \
\
/* Callback-related errors */ \
XX(CB_message_begin, "the on_message_begin callback failed") \
XX(CB_status_complete, "the on_status_complete callback failed") \
XX(CB_url, "the on_url callback failed") \
XX(CB_header_field, "the on_header_field callback failed") \
XX(CB_header_value, "the on_header_value callback failed") \
XX(CB_headers_complete, "the on_headers_complete callback failed") \
XX(CB_body, "the on_body callback failed") \
XX(CB_message_complete, "the on_message_complete callback failed") \
\
/* Parsing-related errors */ \
XX(INVALID_EOF_STATE, "stream ended at an unexpected time") \
XX(HEADER_OVERFLOW, \
"too many header bytes seen; overflow detected") \
XX(CLOSED_CONNECTION, \
"data received after completed connection: close message") \
XX(INVALID_VERSION, "invalid HTTP version") \
XX(INVALID_STATUS, "invalid HTTP status code") \
XX(INVALID_METHOD, "invalid HTTP method") \
XX(INVALID_URL, "invalid URL") \
XX(INVALID_HOST, "invalid host") \
XX(INVALID_PORT, "invalid port") \
XX(INVALID_PATH, "invalid path") \
XX(INVALID_QUERY_STRING, "invalid query string") \
XX(INVALID_FRAGMENT, "invalid fragment") \
XX(LF_EXPECTED, "LF character expected") \
XX(INVALID_HEADER_TOKEN, "invalid character in header") \
XX(INVALID_CONTENT_LENGTH, \
"invalid character in content-length header") \
XX(INVALID_CHUNK_SIZE, \
"invalid character in chunk size header") \
XX(INVALID_CONSTANT, "invalid constant string") \
XX(INVALID_INTERNAL_STATE, "encountered unexpected internal state")\
XX(STRICT, "strict mode assertion failed") \
XX(PAUSED, "parser is paused") \
XX(UNKNOWN, "an unknown error occurred")
/* Define HPE_* values for each errno value above */
#define HTTP_ERRNO_GEN(n, s) HPE_##n,
enum http_errno {
HTTP_ERRNO_MAP(HTTP_ERRNO_GEN)
};
#undef HTTP_ERRNO_GEN
/* Get an http_errno value from an http_parser */
#define HTTP_PARSER_ERRNO(p) ((enum http_errno) (p)->http_errno)
struct http_parser {
/** PRIVATE **/
unsigned int type : 2; /* enum http_parser_type */
unsigned int flags : 6; /* F_* values from 'flags' enum; semi-public */
unsigned int state : 8; /* enum state from http_parser.c */
unsigned int header_state : 8; /* enum header_state from http_parser.c */
unsigned int index : 8; /* index into current matcher */
uint32_t nread; /* # bytes read in various scenarios */
uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */
/** READ-ONLY **/
unsigned short http_major;
unsigned short http_minor;
unsigned int status_code : 16; /* responses only */
unsigned int method : 8; /* requests only */
unsigned int http_errno : 7;
/* 1 = Upgrade header was present and the parser has exited because of that.
* 0 = No upgrade header present.
* Should be checked when http_parser_execute() returns in addition to
* error checking.
*/
unsigned int upgrade : 1;
/** PUBLIC **/
void *data; /* A pointer to get hook to the "connection" or "socket" object */
};
struct http_parser_settings {
http_cb on_message_begin;
http_data_cb on_url;
http_cb on_status_complete;
http_data_cb on_header_field;
http_data_cb on_header_value;
http_cb on_headers_complete;
http_data_cb on_body;
http_cb on_message_complete;
};
enum http_parser_url_fields
{ UF_SCHEMA = 0
, UF_HOST = 1
, UF_PORT = 2
, UF_PATH = 3
, UF_QUERY = 4
, UF_FRAGMENT = 5
, UF_USERINFO = 6
, UF_MAX = 7
};
/* Result structure for http_parser_parse_url().
*
* Callers should index into field_data[] with UF_* values iff field_set
* has the relevant (1 << UF_*) bit set. As a courtesy to clients (and
* because we probably have padding left over), we convert any port to
* a uint16_t.
*/
struct http_parser_url {
uint16_t field_set; /* Bitmask of (1 << UF_*) values */
uint16_t port; /* Converted UF_PORT string */
struct {
uint16_t off; /* Offset into buffer in which field starts */
uint16_t len; /* Length of run in buffer */
} field_data[UF_MAX];
};
/* Returns the library version. Bits 16-23 contain the major version number,
* bits 8-15 the minor version number and bits 0-7 the patch level.
* Usage example:
*
* unsigned long version = http_parser_version();
* unsigned major = (version >> 16) & 255;
* unsigned minor = (version >> 8) & 255;
* unsigned patch = version & 255;
* printf("http_parser v%u.%u.%u\n", major, minor, version);
*/
unsigned long http_parser_version(void);
void http_parser_init(http_parser *parser, enum http_parser_type type);
size_t http_parser_execute(http_parser *parser,
const http_parser_settings *settings,
const char *data,
size_t len);
/* If http_should_keep_alive() in the on_headers_complete or
* on_message_complete callback returns 0, then this should be
* the last message on the connection.
* If you are the server, respond with the "Connection: close" header.
* If you are the client, close the connection.
*/
int http_should_keep_alive(const http_parser *parser);
/* Returns a string version of the HTTP method. */
const char *http_method_str(enum http_method m);
/* Return a string name of the given error */
const char *http_errno_name(enum http_errno err);
/* Return a string description of the given error */
const char *http_errno_description(enum http_errno err);
/* Parse a URL; return nonzero on failure */
int http_parser_parse_url(const char *buf, size_t buflen,
int is_connect,
struct http_parser_url *u);
/* Pause or un-pause the parser; a nonzero value pauses */
void http_parser_pause(http_parser *parser, int paused);
/* Checks if this is the final chunk of the body. */
int http_body_is_final(const http_parser *parser);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -36,13 +36,16 @@ strip_colour(char *string)
/* c is source, c2 is target */
for(; c && *c; c++)
switch (*c) {
switch (*c)
{
case 3:
if(isdigit(c[1])) {
if(isdigit(c[1]))
{
c++;
if(isdigit(c[1]))
c++;
if(c[1] == ',' && isdigit(c[2])) {
if(c[1] == ',' && isdigit(c[2]))
{
c += 2;
if(isdigit(c[1]))
c++;
@ -84,13 +87,16 @@ strip_unprintable(char *string)
/* c is source, c2 is target */
for(; c && *c; c++)
switch (*c) {
switch (*c)
{
case 3:
if(isdigit(c[1])) {
if(isdigit(c[1]))
{
c++;
if(isdigit(c[1]))
c++;
if(c[1] == ',' && isdigit(c[2])) {
if(c[1] == ',' && isdigit(c[2]))
{
c += 2;
if(isdigit(c[1]))
c++;
@ -101,7 +107,7 @@ strip_unprintable(char *string)
*c2++ = *c;
break;
default:
if (*c < 32 && *c >= 0)
if (*c < 32)
break;
*c2++ = *c;
last_non_space = c2;

View File

@ -29,14 +29,16 @@ struct Dictionary; /* defined in src/dictionary.c */
typedef int (*DCF)(const char *a, const char *b);
struct DictionaryElement {
struct DictionaryElement
{
struct DictionaryElement *left, *right, *prev, *next;
void *data;
const char *key;
int position;
};
struct DictionaryIter {
struct DictionaryIter
{
struct DictionaryElement *cur, *next;
};

View File

@ -31,7 +31,8 @@
struct Client;
struct rb_dlink_list;
struct SetOptions {
struct SetOptions
{
int maxclients; /* max clients allowed */
int autoconn; /* autoconn enabled for all servers? */
@ -46,13 +47,15 @@ struct SetOptions {
char adminstring[REALLEN];
};
struct Metadata {
struct Metadata
{
const char *name;
const char *value;
time_t timevalue;
};
struct Counter {
struct Counter
{
int oper; /* Opers */
int total; /* total clients */
int invisi; /* invisible clients */

View File

@ -26,7 +26,8 @@
#ifndef __GETOPT_H_INCLUDED__
#define __GETOPT_H_INCLUDED__
struct lgetopt {
struct lgetopt
{
const char *opt; /* name of the argument */
void *argloc; /* where we store the argument to it (-option argument) */
enum

View File

@ -37,7 +37,8 @@
#include <dlfcn.h>
struct ircd_symbol {
struct ircd_symbol
{
char *sym; /* name of symbol to be bound to ptr */
void *ptr; /* ptr to symbol in library */
};

View File

@ -30,20 +30,22 @@
struct Client;
struct Listener {
struct Listener
{
struct Listener *next; /* list node pointer */
const char *name; /* listener name */
rb_fde_t *F; /* file descriptor */
int ref_count; /* number of connection references */
int active; /* current state of listener */
int ssl; /* ssl listener */
int websocket; /* websocket listener */
int defer_accept; /* use TCP_DEFER_ACCEPT */
struct rb_sockaddr_storage addr;
struct DNSQuery *dns_query;
char vhost[HOSTLEN + 1]; /* virtual name of listener */
};
extern void add_listener(int port, const char *vaddr_ip, int family, int ssl, int defer_accept);
extern void add_listener(int port, const char *vaddr_ip, int family, int ssl, int websocket, int defer_accept);
extern void close_listener(struct Listener *listener);
extern void close_listeners(void);
extern const char *get_listener_name(const struct Listener *listener);

View File

@ -35,7 +35,8 @@
#include "ircd_defs.h"
typedef enum ilogfile {
typedef enum ilogfile
{
L_MAIN,
L_USER,
L_FUSER,

View File

@ -28,7 +28,8 @@
#include "config.h"
typedef struct Information {
typedef struct Information
{
const char *name; /* name of item */
const char *strvalue; /* value of item if it's a boolean */
int intvalue; /* value of item if it's an integer */
@ -63,15 +64,11 @@ Info MyInformation[] = {
#endif /* UH PATH */
#ifdef SOMAXCONN
{
"RATBOX_SOMAXCONN", "", SOMAXCONN,
"Maximum Queue Length of Pending Connections"
},
{"RATBOX_SOMAXCONN", "", SOMAXCONN,
"Maximum Queue Length of Pending Connections"},
#else
{
"RATBOX_SOMAXCONN", "", RATBOX_SOMAXCONN,
"Maximum Queue Length of Pending Connections"
},
{"RATBOX_SOMAXCONN", "", RATBOX_SOMAXCONN,
"Maximum Queue Length of Pending Connections"},
#endif /* SOMAXCONN */
#ifdef RB_IPV6
@ -80,15 +77,11 @@ Info MyInformation[] = {
{"IPV6", "OFF", 0, "IPv6 Support"},
#endif
{
"JOIN_LEAVE_COUNT_EXPIRE_TIME", "", JOIN_LEAVE_COUNT_EXPIRE_TIME,
"Anti SpamBot Parameter"
},
{"JOIN_LEAVE_COUNT_EXPIRE_TIME", "", JOIN_LEAVE_COUNT_EXPIRE_TIME,
"Anti SpamBot Parameter"},
{
"KILLCHASETIMELIMIT", "", KILLCHASETIMELIMIT,
"Nick Change Tracker for KILL"
},
{"KILLCHASETIMELIMIT", "", KILLCHASETIMELIMIT,
"Nick Change Tracker for KILL"},
#ifdef LPATH
{"LPATH", LPATH, 0, "Path to Log File"},
@ -98,15 +91,11 @@ Info MyInformation[] = {
{"MAX_BUFFER", "", MAX_BUFFER, "Maximum Buffer Connections Allowed"},
{
"MAX_JOIN_LEAVE_COUNT", "", MAX_JOIN_LEAVE_COUNT,
"Anti SpamBot Parameter"
},
{"MAX_JOIN_LEAVE_COUNT", "", MAX_JOIN_LEAVE_COUNT,
"Anti SpamBot Parameter"},
{
"MIN_JOIN_LEAVE_TIME", "", MIN_JOIN_LEAVE_TIME,
"Anti SpamBot Parameter"
},
{"MIN_JOIN_LEAVE_TIME", "", MIN_JOIN_LEAVE_TIME,
"Anti SpamBot Parameter"},
#ifdef MPATH
{"MPATH", MPATH, 0, "Path to MOTD File"},
@ -114,10 +103,8 @@ Info MyInformation[] = {
{"MPATH", "NONE", 0, "Path to MOTD File"},
#endif /* MPATH */
{
"NICKNAMEHISTORYLENGTH", "", NICKNAMEHISTORYLENGTH,
"Size of WHOWAS Array"
},
{"NICKNAMEHISTORYLENGTH", "", NICKNAMEHISTORYLENGTH,
"Size of WHOWAS Array"},
#ifdef OPATH
{"OPATH", OPATH, 0, "Path to Operator MOTD File"},
@ -125,10 +112,8 @@ Info MyInformation[] = {
{"OPATH", "NONE", 0, "Path to Operator MOTD File"},
#endif /* OPATH */
{
"OPER_SPAM_COUNTDOWN", "", OPER_SPAM_COUNTDOWN,
"Anti SpamBot Parameter"
},
{"OPER_SPAM_COUNTDOWN", "", OPER_SPAM_COUNTDOWN,
"Anti SpamBot Parameter"},
#ifdef HAVE_LIBCRYPTO
{"HAVE_LIBCRYPTO", "ON", 0, "Enable OpenSSL CHALLENGE Support"},
@ -156,14 +141,10 @@ Info MyInformation[] = {
{"SPATH", "NONE", 0, "Path to Server Executable"},
#endif /* SPATH */
{
"TS_MAX_DELTA_DEFAULT", "", TS_MAX_DELTA_DEFAULT,
"Maximum Allowed TS Delta from another Server"
},
{
"TS_WARN_DELTA_DEFAULT", "", TS_WARN_DELTA_DEFAULT,
"Maximum TS Delta before Sending Warning"
},
{"TS_MAX_DELTA_DEFAULT", "", TS_MAX_DELTA_DEFAULT,
"Maximum Allowed TS Delta from another Server"},
{"TS_WARN_DELTA_DEFAULT", "", TS_WARN_DELTA_DEFAULT,
"Maximum TS Delta before Sending Warning"},
#ifdef USE_IODEBUG_HOOKS
{"USE_IODEBUG_HOOKS", "YES", 0, "IO Debugging support"},
#else

View File

@ -41,7 +41,8 @@
#include "msg.h"
#include "hook.h"
struct module {
struct module
{
char *name;
const char *version;
void *address;
@ -50,7 +51,8 @@ struct module {
void * mapi_header; /* actually struct mapi_mheader_av<mapi_version> */
};
struct module_path {
struct module_path
{
char path[MAXPATHLEN];
};
@ -63,17 +65,20 @@ struct module_path {
typedef struct Message* mapi_clist_av1;
typedef struct {
typedef struct
{
const char * hapi_name;
int * hapi_id;
} mapi_hlist_av1;
typedef struct {
typedef struct
{
const char * hapi_name;
hookfn fn;
} mapi_hfn_list_av1;
struct mapi_mheader_av1 {
struct mapi_mheader_av1
{
int mapi_version; /* Module API version */
int (*mapi_register) (void); /* Register function;
ret -1 = failure (unload) */

View File

@ -11,7 +11,8 @@
struct rb_bh;
struct monitor {
struct monitor
{
struct monitor *hnext;
char name[NICKLEN];
rb_dlink_list users;

View File

@ -31,7 +31,8 @@
struct Client;
/* MessageHandler */
typedef enum HandlerType {
typedef enum HandlerType
{
UNREGISTERED_HANDLER,
CLIENT_HANDLER,
RCLIENT_HANDLER,
@ -49,13 +50,15 @@ HandlerType;
*/
typedef int (*MessageHandler) (struct Client *, struct Client *, int, const char *[]);
struct MessageEntry {
struct MessageEntry
{
MessageHandler handler;
int min_para;
};
/* Message table structure */
struct Message {
struct Message
{
const char *cmd;
unsigned int count; /* number of times command used */
unsigned int rcount; /* number of times command used by server */

View File

@ -5,7 +5,8 @@
#ifndef _NEWCONF_H_INCLUDED
#define _NEWCONF_H_INCLUDED
struct ConfEntry {
struct ConfEntry
{
const char *cf_name;
int cf_type;
void (*cf_func) (void *);
@ -13,7 +14,8 @@ struct ConfEntry {
void *cf_arg;
};
struct TopConf {
struct TopConf
{
const char *tc_name;
int (*tc_sfunc) (struct TopConf *);
int (*tc_efunc) (struct TopConf *);
@ -35,10 +37,12 @@ struct TopConf {
#define CF_FLIST 0x1000
#define CF_MFLAG 0xFF00
typedef struct conf_parm_t_stru {
typedef struct conf_parm_t_stru
{
struct conf_parm_t_stru *next;
int type;
union {
union
{
char *string;
int number;
struct conf_parm_t_stru *list;

View File

@ -18,12 +18,14 @@
*/
#define IRCD_MAXNS 10
struct DNSReply {
struct DNSReply
{
char *h_name;
struct rb_sockaddr_storage addr;
};
struct DNSQuery {
struct DNSQuery
{
void *ptr; /* pointer used by callback to identify request */
void (*callback)(void* vptr, struct DNSReply *reply); /* callback to call */
};

View File

@ -34,7 +34,8 @@
#define RRFIXEDSZ 10
#define HFIXEDSZ 12
typedef struct {
typedef struct
{
unsigned id :16; /* query identification number */
#ifdef WORDS_BIGENDIAN
/* fields in third byte */

View File

@ -43,7 +43,8 @@ struct hostent;
/* used by new parser */
/* yacc/lex love globals!!! */
struct ip_value {
struct ip_value
{
struct rb_sockaddr_storage ip;
int ip_mask;
int type;
@ -52,11 +53,13 @@ struct ip_value {
extern FILE *conf_fbfile_in;
extern char conf_line_in[256];
struct ConfItem {
struct ConfItem
{
unsigned int status; /* If CONF_ILLEGAL, delete when no clients */
unsigned int flags;
int clients; /* Number of *LOCAL* clients using this */
union {
union
{
char *name; /* IRC name, nick, server name, or original u@h */
const char *oper;
} info;
@ -134,7 +137,8 @@ struct ConfItem {
/* flag definitions for opers now in client.h */
struct config_file_entry {
struct config_file_entry
{
const char *dpath; /* DPATH if set from command line */
const char *configfile;
@ -232,7 +236,8 @@ struct config_file_entry {
int away_interval;
};
struct config_channel_entry {
struct config_channel_entry
{
char * autochanmodes;
char * exemptchanops;
char * disabledmodes;
@ -271,14 +276,16 @@ struct config_channel_entry {
int exempt_cmode_K;
};
struct config_server_hide {
struct config_server_hide
{
int flatten_links;
int links_delay;
int hidden;
int disable_hidden;
};
struct server_info {
struct server_info
{
char *name;
char sid[4];
char *description;
@ -303,13 +310,15 @@ struct server_info {
int ssld_count;
};
struct admin_info {
struct admin_info
{
char *name;
char *description;
char *email;
};
struct alias_entry {
struct alias_entry
{
char *name;
char *target;
int flags; /* reserved for later use */
@ -330,7 +339,8 @@ extern rb_dlink_list service_list;
extern rb_dlink_list prop_bans;
typedef enum temp_list {
typedef enum temp_list
{
TEMP_MIN,
TEMP_HOUR,
TEMP_DAY,

View File

@ -59,7 +59,8 @@ extern void init_s_newconf(void);
extern void clear_s_newconf(void);
extern void clear_s_newconf_bans(void);
typedef struct {
typedef struct
{
char *ip;
time_t expiry;
rb_patricia_node_t *pnode;
@ -70,7 +71,8 @@ void add_tgchange(const char *host);
tgchange *find_tgchange(const char *host);
/* shared/cluster/hub/leaf confs */
struct remote_conf {
struct remote_conf
{
char *username;
char *host;
char *server;
@ -105,7 +107,8 @@ struct remote_conf {
#define CONF_HUB 0x0001
#define CONF_LEAF 0x0002
struct oper_conf {
struct oper_conf
{
char *name;
char *username;
char *host;
@ -178,7 +181,8 @@ extern struct oper_conf *find_oper_conf(const char *username, const char *host,
extern const char *get_oper_privs(int flags);
struct server_conf {
struct server_conf
{
char *name;
char *host;
char *passwd;
@ -236,7 +240,8 @@ extern int valid_wild_card_simple(const char *);
extern int clean_resv_nick(const char *);
time_t valid_temp_time(const char *p);
struct nd_entry {
struct nd_entry
{
char name[NICKLEN+1];
time_t expire;
rb_dlink_node lnode; /* node in ll */

View File

@ -46,7 +46,8 @@ struct server_conf;
struct Channel;
/* Capabilities */
struct Capability {
struct Capability
{
const char *name; /* name of capability */
unsigned int cap; /* mask value */
unsigned int required; /* 1 if required, 0 if not */

View File

@ -39,7 +39,8 @@ struct Client;
/*
* statistics structures
*/
struct ServerStatistics {
struct ServerStatistics
{
unsigned int is_cl; /* number of client connections */
unsigned int is_sv; /* number of server connections */
unsigned int is_ni; /* connection but no idea who it was */

View File

@ -240,7 +240,7 @@
/* Directory where binaries the IRCd itself spawns live */
#undef PKGLIBEXECDIR
/* Directory in which to store state, such as ban database */
/* Directory in which to store state, such as band database */
#undef PKGLOCALSTATEDIR
/* Directory to store pidfile in. */

View File

@ -45,7 +45,8 @@ struct Client;
also removed away information. *tough*
- Dianora
*/
struct Whowas {
struct Whowas
{
int hashv;
char name[NICKLEN + 1];
char username[USERLEN + 1];

View File

@ -1,8 +1,9 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -15,51 +16,6 @@
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@ -79,12 +35,12 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
$(top_srcdir)/include/libratbox_config.h.in \
$(srcdir)/libratbox.pc.in COPYING ChangeLog INSTALL README \
TODO compile config.guess config.sub depcomp install-sh \
missing ltmain.sh
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/libratbox.pc.in \
$(top_srcdir)/configure \
$(top_srcdir)/include/libratbox_config.h.in COPYING ChangeLog \
INSTALL TODO config.guess config.sub depcomp install-sh \
ltmain.sh missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
@ -96,33 +52,15 @@ mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/include/libratbox_config.h
CONFIG_CLEAN_FILES = libratbox.pc
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@ -144,53 +82,23 @@ am__nobase_list = $(am__nobase_strip_setup); \
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
DATA = $(pkgconfig_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
distdir dist dist-all distcheck
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
{ test ! -d "$(distdir)" \
|| { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr "$(distdir)"; }; }
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
@ -218,15 +126,11 @@ am__relativize = \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
DIST_TARGETS = dist-gzip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
@ -362,7 +266,7 @@ pkgconfig_DATA = libratbox.pc
all: all-recursive
.SUFFIXES:
am--refresh: Makefile
am--refresh:
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
@ -398,8 +302,10 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__aclocal_m4_deps):
include/libratbox_config.h: include/stamp-h1
@test -f $@ || rm -f include/stamp-h1
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) include/stamp-h1
@if test ! -f $@; then \
rm -f include/stamp-h1; \
$(MAKE) $(AM_MAKEFLAGS) include/stamp-h1; \
else :; fi
include/stamp-h1: $(top_srcdir)/include/libratbox_config.h.in $(top_builddir)/config.status
@rm -f include/stamp-h1
@ -424,11 +330,8 @@ distclean-libtool:
-rm -f libtool config.lt
install-pkgconfigDATA: $(pkgconfig_DATA)
@$(NORMAL_INSTALL)
test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
@ -442,28 +345,27 @@ uninstall-pkgconfigDATA:
@$(NORMAL_UNINSTALL)
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
@ -478,12 +380,57 @@ $(am__recursive_targets):
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
$(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@ -499,7 +446,12 @@ tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
@ -511,11 +463,15 @@ tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
@ -524,31 +480,9 @@ GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscope: cscope.files
test ! -s cscope.files \
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
clean-cscope:
-rm -f cscope.files
cscope.files: clean-cscope cscopelist
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES)
$(am__remove_distdir)
@ -584,10 +518,13 @@ distdir: $(DISTFILES)
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
@ -616,42 +553,36 @@ distdir: $(DISTFILES)
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir)
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
$(am__remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
$(am__remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
$(am__remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__post_remove_distdir)
$(am__remove_distdir)
dist dist-all:
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
$(am__post_remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
@ -662,8 +593,8 @@ distcheck: dist
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.lzma*) \
lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
@ -673,19 +604,17 @@ distcheck: dist
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_inst
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
@ -708,21 +637,13 @@ distcheck: dist
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__post_remove_distdir)
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
@$(am__cd) '$(distuninstallcheck_dir)' \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
@ -756,15 +677,10 @@ install-am: all-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
@ -846,24 +762,25 @@ ps-am:
uninstall-am: uninstall-pkgconfigDATA
.MAKE: $(am__recursive_targets) install-am install-strip
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
install-am install-strip tags-recursive
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
clean-libtool cscope cscopelist-am ctags ctags-am dist \
dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
dist-xz dist-zip distcheck distclean distclean-generic \
distclean-hdr distclean-libtool distclean-tags distcleancheck \
distdir distuninstallcheck dvi dvi-am html html-am info \
info-am install install-am install-data install-data-am \
install-dvi install-dvi-am install-exec install-exec-am \
install-html install-html-am install-info install-info-am \
install-man install-pdf install-pdf-am install-pkgconfigDATA \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
distcheck distclean distclean-generic distclean-hdr \
distclean-libtool distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-pkgconfigDATA install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am uninstall-pkgconfigDATA
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am uninstall-pkgconfigDATA
# Tell versions [3.59,3.63) of GNU make to not export all variables.

983
libratbox/aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,347 +0,0 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

808
libratbox/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -68,7 +68,8 @@
#else
#define RB_UIO_MAXIOV 16
#endif
struct conndata {
struct conndata
{
/* We don't need the host here ? */
struct rb_sockaddr_storage S;
struct rb_sockaddr_storage hostaddr;
@ -78,7 +79,8 @@ struct conndata {
/* We'd also add the retry count here when we get to that -- adrian */
};
struct acceptdata {
struct acceptdata
{
struct rb_sockaddr_storage S;
rb_socklen_t addrlen;
ACCB *callback;
@ -93,7 +95,8 @@ struct acceptdata {
#define ClearFDOpen(F) (F->flags &= ~FLAG_OPEN)
struct _fde {
struct _fde
{
/* New-school stuff, again pretty much ripped from squid */
/*
* Yes, this gives us only one pending read and one pending write per
@ -120,7 +123,8 @@ struct _fde {
typedef void (*comm_event_cb_t) (void *);
#ifdef USE_TIMER_CREATE
typedef struct timer_data {
typedef struct timer_data
{
timer_t td_timer_id;
comm_event_cb_t td_cb;
void *td_udata;
@ -144,7 +148,8 @@ rb_find_fd(int fd)
if(hlist->head == NULL)
return NULL;
RB_DLINK_FOREACH(ptr, hlist->head) {
RB_DLINK_FOREACH(ptr, hlist->head)
{
rb_fde_t *F = ptr->data;
if(F->fd == fd)
return F;

View File

@ -22,7 +22,8 @@
*
*/
struct ev_entry {
struct ev_entry
{
rb_dlink_node node;
EVH *func;
void *arg;

Some files were not shown because too many files have changed in this diff Show More