Compare commits

..

92 Commits

Author SHA1 Message Date
Sam Dodrill a99df1c02c do another go of rb_.*printf removal 2014-12-15 21:07:22 -08:00
Sam Dodrill 1ac5b0570e replace rb_snprintf with system snprintf 2014-12-15 20:39:52 -08:00
Sam Dodrill 63a50eaabc naiive s/rb_sprintf/sprintf/g 2014-12-15 20:34:55 -08:00
Sam Dodrill ee03711af4 Merge pull request #34 from Elemental-IRCd/staging/6.6.1
Elemental-IRCd 6.6.1
2014-12-13 15:59:15 -08:00
Sam Dodrill e862c03515 src/newconf: add ability to disable UMODE_HIDECHANS
As requested by a staff member of an IRC network using elemental.
2014-12-10 14:33:25 -08:00
Sam Dodrill 7cfa92c570 Elemental-IRCd 6.6.1 2014-12-08 09:21:04 -08:00
Sam Dodrill eda8b64bd6 Manually merge feat/show-ip-on-iline-cloak
Conflicts:
    src/s_user.c

Spoofed host IP addresses are now broadcast.

This is 2014, we are not EFNet.
2014-12-08 09:18:30 -08:00
Sam Dodrill 8ea110ad78 Merge pull request #35 from KJCracks/master
Fixed Anope protocol module
2014-12-06 10:23:51 -08:00
Terence Tan 79a3bf79ae Update elemental-ircd.cpp 2014-12-06 20:13:37 +08:00
Sam Dodrill 05b16194a3 Merge pull request #22 from Hamcha/master
Allow compilation for targets without EGD (ie LibreSSL)
2014-11-21 04:30:48 +00:00
Sam Dodrill cf6fdf5e76 Merge pull request #32 from Elemental-IRCd/fix/chmode/separate-length-limits
src/chmode: treat invex/ban/quiet/exception discretely
2014-11-21 04:30:29 +00:00
Sam Dodrill 5ba9c76d22 src/chmode: treat invex/ban/quiet/exception discretely
Also prevents unneeded O(n) check of all kinds of list-bans to see if
the list has overflowed and prevents hard-coding of list-like channel
modes in the daemon to allow for future expansion.
2014-10-27 16:07:27 -07:00
Hamcha dd021e6449 Fallback only if EGD is selected 2014-10-12 01:05:06 +02:00
Hamcha bd91ef662b Fixed conding style (tab->spaces) 2014-10-12 01:02:17 +02:00
Sam Dodrill 219934c7ce Add lvimrc to automatically format code to the desired style
Users of other editors are encouraged to do something similar to this.
2014-09-16 20:27:24 -07:00
Sam Dodrill 1bb06bb3d0 Merge pull request #29 from Elemental-IRCd/doc/contributing
CONTRIBUTING: clarify style requirements
2014-09-15 15:47:16 -07:00
Sam Dodrill cb1ff884a1 CONTRIBUTING: clarify style requirements 2014-09-15 14:26:14 -07:00
Sam Dodrill bfac4f3498 Dockerfile: make docker image thinner 2014-09-08 10:58:01 -07:00
Sam Dodrill 095d9fdd1a Dockerfile: change to use deis/init 2014-08-09 21:54:07 -07:00
Apple Dash 7d3966bc9b m_away: Fix potential weird behavior with an empty return 2014-08-09 18:53:18 -04:00
Hamcha b1bd65b6ab Fix conflicts with PR #24
Conflicts:
	libratbox/src/openssl.c
2014-08-08 14:10:34 +02:00
Sam Dodrill 46bf689e52 Merge pull request #23 from Elemental-IRCd/chore/contributing-document
Add contirbution guidelines
2014-08-06 18:14:04 -07:00
Sam Dodrill 22db314d25 Merge pull request #24 from Elemental-IRCd/chore/restyle-code
Change all code to a consistent style
2014-08-06 18:13:29 -07:00
Sam Dodrill 9890a48cd9 Change all code to a consistent style
We use the Linux Kernel format now.
2014-08-03 10:38:55 -07:00
Sam Dodrill 4c0924c242 Add contirbution guidelines 2014-08-03 09:57:53 -07:00
Hamcha 0cea0c17d2 Allow compilation for targets without EGD (ie LibreSSL) 2014-08-03 12:30:51 +02:00
Sam Dodrill 027b2310ca Add irc notifications for travis 2014-08-02 22:35:57 -07:00
Sam Dodrill 923cda96ff Add travis support 2014-08-02 22:25:37 -07:00
Sam Dodrill 13221ce579 Merge pull request #21 from Elemental-IRCd/feat/dockerfile
Add Dockerfile
2014-08-02 22:05:50 -07:00
Sam Dodrill 379a56e808 Add Dockerfile
This is so people can base their projects on elemental-ircd.
2014-08-02 22:02:59 -07:00
Sam Dodrill e12b8a2631 Elemental-IRCd 6.6 2014-08-01 18:27:50 -07:00
Sam Dodrill 4810e6a8d4 Merge branch 'staging/elemental-6.6' 2014-08-01 18:24:31 -07:00
Jilles Tjoelker 0ae1f793d9 libratbox: Fix undefined behaviour advancing pointer beyond end of array.
The C standard does not allow constructing pointers beyond one past the end
of an array. Therefore, if size is an unsigned type (size_t), then
buf + size is never less than buf.

Clang on 32-bit took advantage of the undefined behaviour, causing
segfaults.

(cherry picked from commit fab79c5d25423884fc4f5e0a56d97cb59b618196)
2014-08-01 18:23:59 -07:00
Rylee Fowler e0489d0eec atheme module: remove trailing whitespace 2014-08-01 18:23:59 -07:00
AppleDash 4d07bf5c59 ./Config: Remove unneeded code and handle ^D 2014-08-01 18:23:58 -07:00
AppleDash 47130005ae ./Config: Somewhat rewrote script, improved nicklen prompting and interrupt handling. 2014-08-01 18:23:58 -07:00
Rylee Fowler 26005c6f48 fix spelling typo (s/propegate/propagate/g) 2014-08-01 18:23:58 -07:00
Sam Dodrill 6a55b37bd9 example conf: add tor blacklist 2014-08-01 18:23:58 -07:00
Apple Dash e05337fa2e include/cache.h: Add support for bigmatix. 2014-08-01 18:23:58 -07:00
Sam Dodrill 3c7006c286 example conf: add tor blacklist 2014-06-11 11:44:20 -07:00
Sam Dodrill fb096745d8 Fix autotools build system 2014-06-09 16:10:15 -07:00
Sam Dodrill fdd6c2721a Merge pull request #10 from AppleDash/master
include/cache.h: Add support for wider motds
2014-06-02 07:40:24 -07:00
Apple Dash 263bc51300 include/cache.h: Add support for bigmatix. 2014-06-02 10:35:51 -04:00
Sam Dodrill 990a42b71b Staging for Elemental-IRCd 6.6 release 2014-06-01 16:09:24 -07:00
Sam Dodrill 19d656a29b Fix buffer overflow in introduce_client and burst_TS6
If the client being introduced has more than 10 user modes send_umode()
will overflow ubuf

tracks Adam-/charybdis@9744d53ec9
2014-06-01 15:59:00 -07:00
Sam Dodrill d726cc83a2 Add UMODE +I to hide channels in WHOIS line
Does not hide channels from IRC operators.
2014-06-01 15:52:10 -07:00
Sam Dodrill 8036a22c25 Show remote server IP addresses 2014-06-01 15:20:37 -07:00
Sam Dodrill 050ea2b809 Add channel mode +u to hide banlists
Banlists are silently hidden from all non-halfops or up. Bans still may
be seen as normally. This mode is entirely opt-in.
2014-05-28 19:36:14 -07:00
Sam Dodrill 9a90d0d80e src/s_user: Prevent desync of clients on CHGHOST 2014-04-29 13:18:39 -07:00
Sam Dodrill 2a8868cfe3 tools/genssl: Make certificates last for 3560 days 2014-04-22 12:22:33 -07:00
Andrew Cook b781b52396 stringops: Don't strip unicode in strip_unprintable 2014-04-22 12:15:25 -07:00
Sam Dodrill 02b334ff8f Fix extended-join for remote and fakequit users 2014-04-22 11:38:17 -07:00
Sam Dodrill ae6e4d3352 Config: Remove clear call 2014-04-22 10:16:24 -07:00
Sam Dodrill 6ccb7036db Config script: Disallow turning off SSL
There is no good reason SSL should ever be disabled.
2014-04-16 11:12:29 -07:00
Sam Dodrill f31302d01d Merge branch 'configure-script' 2014-04-15 10:42:17 -07:00
Sam Dodrill 685eed838a README: Update README 2014-04-15 10:40:12 -07:00
Sam Dodrill d23dc975b3 TODO: Update for 6.5.2 2014-04-15 10:28:54 -07:00
Sam Dodrill 4d941d3f49 modules/m_post: Remove snotes
Change made to track upstream
2014-04-12 07:28:41 -07:00
Sam Dodrill 53c7dba717 example confs: Remove AHBL blacklists, which are no longer available. 2014-04-11 11:16:59 -07:00
Sam Dodrill 0953068ef0 m_part: Add quotes around part reason
This is a practice already used by some networks including freenode. It
makes it possible to distinguish user part messages and forced parts
such as /remove.

ref: atheme/charybdis@a0b4a9216d
2014-04-11 11:13:00 -07:00
Sam Dodrill f5945c6972 modules/core/m_message: Flood notices now global
To ease centralized management.
2014-04-10 20:29:11 -07:00
Sam Dodrill a5e296e4eb modules/m_sasl: sasl: fix regression introduced by sasl <-> auth_user integration.
This fixes the null-dereference reported on full-disclosure [1].  A
corrected analysis of the issue
follows below:

When SASL authentication completes, and auth_user is requested,
client_p->user may be NULL. Thusly accessing fields of client_p->user
may cause a null dereference. In these cases, aborting SASL auth
early is a correct interpretation of the IRCv3.1 specification.  The
code must handle this situation, which this commit corrects.

[1]: http://seclists.org/fulldisclosure/2014/Mar/320
2014-03-23 13:57:49 -07:00
Sam Dodrill 1bd7b59879 clicaps: Disable away-notify for now 2014-03-20 07:42:29 -07:00
Sam Dodrill 3a8780867a modules/m_sasl: Emergency patch for m_sasl. Details on full-disclosure 2014-03-17 11:02:55 -07:00
Sam Dodrill be813f8605 src/channel: fix possible null reference in joining 2014-03-09 15:42:07 -07:00
Sam Dodrill c649e42ae9 extensions/m_roleplay: Transmit source name with message 2014-02-18 09:50:59 -08:00
Sam Dodrill a7a510a504 src/supported: add OWNER to 005 output 2014-02-18 08:50:25 -08:00
Sam Dodrill 174c8b49b1 Merge branch 'services-modules' 2014-02-14 19:32:13 -08:00
Sam Dodrill 0ebe9a5930 Merge branch 'purge-cruft' 2014-02-14 19:32:02 -08:00
Sam Dodrill eceffbca02 src/messages.tab: Make ERR_NOOPERHOST more generic 2014-02-14 19:28:40 -08:00
Sam Dodrill 06bfe138d2 modules/m_oper: Prevent password guessing
Change the message for an invalid OPER password to "No appropriate
operator blocks were found for your host".
2014-02-14 19:28:40 -08:00
Sam Dodrill 20b066f6f4 Add TODO for elemental-ircd 6.6 2014-02-02 08:54:48 -08:00
Sam Dodrill 8f1d057a36 Remove old files from the root and finish rebrand 2014-01-30 19:49:46 -08:00
Sam Dodrill 74289701af src/s_user: Add metadata for cloaked hostnames for use with services 2014-01-30 22:37:46 -05:00
Sam Dodrill 1a536989b2 extra: Add modules for services packages 2014-01-30 19:23:52 -08:00
Sam Dodrill 55147df5de src/s_user: Make UID assignment happen once we know it's a valid user 2014-01-29 21:14:09 -08:00
Sam Dodrill 40249913ca Config: Add prototype auto-configuration script 2014-01-26 10:27:59 -08:00
Sam Dodrill 177241882c Merge branch 'ircv3-metadata'
Allow support for the ircv3 metadata verbs while maintaining backwards
compatibility with the old ShadowIRCD verbs
2014-01-17 08:19:39 -08:00
Sam Dodrill ba15f6d690 Merge branch 'fix-non-qs-ts6' 2014-01-17 05:09:40 -08:00
Sam Dodrill d4ea7f897e Merge branch 'grammatical-errors' 2014-01-17 05:09:33 -08:00
Sam Dodrill a3da200088 Merge branch 'owners-immune' 2014-01-17 05:09:16 -08:00
Sam Dodrill 6faf3c2a45 src/client: Remove TS5 logic in the link protocol 2014-01-17 05:07:41 -08:00
Sam Dodrill 3bf316e2dc help: Fix some required oper privileges.
references atheme@charybdis/1de147abc5b145ea3b7c09128ee8d8fb19726ef4
2014-01-11 17:53:50 -08:00
Sam Dodrill 2e1fbf8292 extensions/chm_sslonly: Fix grammatical error
References atheme@charybdis/46b55df60bfbb1d9fa640a819ba270d708e3d2b0
2014-01-11 17:51:36 -08:00
Sam Dodrill c03f7b30c4 bandb: Don't attempt to write to a NULL helper.
Though without a bandb binary your installation is completely screwed.

References atheme@charybdis/c8729b08fb171d80030155c638a65aff93cb1a45
2014-01-11 17:49:21 -08:00
Sam Dodrill 80b3a83cbf src/channel: Fix ordering in kick permission logic 2014-01-10 18:16:08 -08:00
Sam Dodrill 3cfbe05aff Bump up SSL cert generation strength 2014-01-01 04:03:45 -08:00
Sam Dodrill 2f35248278 modules/m_whois: Allow clients to see their own umodes when whoising themselves 2013-12-27 09:32:49 -08:00
Sam Dodrill 0785419045 Remove autojoin_opers
It was broken by the away-notify patch and fixing it is more work than
the feature is useful.
2013-12-26 15:08:55 -08:00
Sam Dodrill 755b88c783 Revert autojoin_opers patch
It causes interesting desyncs of account names when run for more than 2
weeks

Revert "channel: refactor fe3c1c828e and fix surrounding indentation"

This reverts commit 27b08207de.

Revert "src/channel: Fix for autojoin_opers segfault"

This reverts commit 8e1c8b7543.
2013-12-26 15:05:15 -08:00
Sam Dodrill 8bff90d496 modules/core/m_metadata: Re-add support for the old metadata verbs and document the old metadata system. 2013-11-24 14:22:51 -08:00
Sam Dodrill 5810ebb18f modules/code/m_metadata: Changed to conform to IRCv3 command spec 2013-11-24 14:11:00 -08:00
299 changed files with 48684 additions and 52118 deletions

2
.lvimrc Normal file
View File

@ -0,0 +1,2 @@
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'

12
.travis.yml Normal file
View File

@ -0,0 +1,12 @@
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"

20
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,20 @@
# 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,14 +1,23 @@
$Id: CREDITS 3133 2007-01-21 15:38:16Z jilles $ $Id: CREDITS 3133 2007-01-21 15:38:16Z jilles $
elemental-ircd is a fork of the ShadowIRCD project created to meet 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
PonyChat's needs and keep the now-defunct ShadowIRCD project's goals PonyChat's needs and keep the now-defunct ShadowIRCD project's goals
alive. alive.
The elemental-ircd team is listed in nick-alphabetical order: The ponychat-ircd team is listed in nick-alphabetical order:
aji, Alex Iadicico <alex -at- ajitek.net> aji, Alex Iadicico <alex -at- ajitek.net>
lyska, Sam Dodrill <shadowh511 -at- gmail.com>>
Kabaka, Kyle Johnson <kabaka -at- ponychat.net> 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 ShadowIRCd 6 is a modern restart of the old ShadowIRCd project
based on Charybdis with a few additional features to make it appeal based on Charybdis with a few additional features to make it appeal

99
Config Executable file
View File

@ -0,0 +1,99 @@
#!/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

22
Dockerfile Normal file
View File

@ -0,0 +1,22 @@
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
View File

@ -1,37 +0,0 @@
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

View File

@ -1,6 +0,0 @@
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,6 +1,60 @@
This is elemental-ircd 6.5, Copyright (c) 2013 elemental-ircd team. This is elemental-ircd 6.6.1, Copyright (c) 2014 elemental-ircd team.
See LICENSE for licensing details (GPL v2). 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 -- ponychat-ircd 6.5
additions additions

View File

@ -1,100 +0,0 @@
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,18 +1,35 @@
# elemental-ircd # Elemental-IRCd
**elemental-ircd** is a high performance, lightweight, and scalable **Elemental-IRCd** is a high performance, lightweight, and scalable
IRC daemon. It is a fork of the now-defunct ShadowIRCD created to meet IRC daemon. It is a fork of the now-defunct ShadowIRCD and seeks to continue in
PonyChat's needs, and seeks to continue in the direction ShadowIRCD the direction ShadowIRCD was headed.
was headed.
## Supported Platforms ## Supported Platforms
<Cassy> If you put something on a platform which cannot support it All modern \*NIX systems should work. You need the equivalent of the following
it may tip and fall and become broken. Simple physics. 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.
## Support ## Support
Our support channel is `#rainbow-factory` on `irc.ponychat.net`. Poke The official channel for Elemental-IRCd is `#elemental-ircd` on
**aji**, **lyska**, or **Kabaka** for help. `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.
To report bugs, please use the GitHub issue tracker. To report bugs, please use the GitHub issue tracker.

61
TODO
View File

@ -1,61 +0,0 @@
/ = 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?

View File

@ -1,5 +0,0 @@
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

23
TODO.markdown Normal file
View File

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

View File

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

View File

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

View File

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

View File

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

22
configure vendored
View File

@ -1,8 +1,8 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for elemental-ircd 6.5.1. # Generated by GNU Autoconf 2.69 for elemental-ircd 6.6.1.
# #
# $Id: configure.ac 3516 2007-06-10 16:14:03Z jilles $ # 2014 elemental-ircd Team
# #
# #
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@ -579,8 +579,8 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='elemental-ircd' PACKAGE_NAME='elemental-ircd'
PACKAGE_TARNAME='elemental-ircd' PACKAGE_TARNAME='elemental-ircd'
PACKAGE_VERSION='6.5.1' PACKAGE_VERSION='6.6.1'
PACKAGE_STRING='elemental-ircd 6.5.1' PACKAGE_STRING='elemental-ircd 6.6.1'
PACKAGE_BUGREPORT='' PACKAGE_BUGREPORT=''
PACKAGE_URL='' 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. # 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. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures elemental-ircd 6.5.1 to adapt to many kinds of systems. \`configure' configures elemental-ircd 6.6.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1364,7 +1364,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of elemental-ircd 6.5.1:";; short | recursive ) echo "Configuration of elemental-ircd 6.6.1:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@ -1488,14 +1488,14 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
elemental-ircd configure 6.5.1 elemental-ircd configure 6.6.1
generated by GNU Autoconf 2.69 generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc. Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it. gives unlimited permission to copy, distribute and modify it.
$Id: configure.ac 3516 2007-06-10 16:14:03Z jilles $ 2014 elemental-ircd Team
_ACEOF _ACEOF
exit exit
fi fi
@ -2092,7 +2092,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by elemental-ircd $as_me 6.5.1, which was It was created by elemental-ircd $as_me 6.6.1, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@ $ $0 $@
@ -10100,7 +10100,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by elemental-ircd $as_me 6.5.1, which was This file was extended by elemental-ircd $as_me 6.6.1, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -10166,7 +10166,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\ ac_cs_version="\\
elemental-ircd config.status 6.5.1 elemental-ircd config.status 6.6.1
configured by $0, generated by GNU Autoconf 2.69, configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\" 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) AC_PREREQ(2.57)
dnl Sneaky way to get an Id tag into the configure script dnl Sneaky way to get an Id tag into the configure script
AC_COPYRIGHT([$Id: configure.ac 3516 2007-06-10 16:14:03Z jilles $]) AC_COPYRIGHT([2014 elemental-ircd Team])
AC_INIT([elemental-ircd],[6.5.1]) AC_INIT([elemental-ircd],[6.6.1])
AC_CONFIG_HEADER(include/setup.h) AC_CONFIG_HEADER(include/setup.h)
@ -253,7 +253,7 @@ AC_SUBST([pkglibdir])
AC_SUBST([rundir]) AC_SUBST([rundir])
AC_SUBST([pkgrundir]) AC_SUBST([pkgrundir])
AC_SUBST([pkglocalstatedir]) AC_SUBST([pkglocalstatedir])
AC_DEFINE_DIR([PKGLOCALSTATEDIR], [pkglocalstatedir], [[Directory in which to store state, such as band database]]) AC_DEFINE_DIR([PKGLOCALSTATEDIR], [pkglocalstatedir], [[Directory in which to store state, such as ban database]])
AC_SUBST([pkglibexecdir]) AC_SUBST([pkglibexecdir])
AC_DEFINE_DIR([PKGLIBEXECDIR], [pkglibexecdir], [Directory where binaries the IRCd itself spawns live]) AC_DEFINE_DIR([PKGLIBEXECDIR], [pkglibexecdir], [Directory where binaries the IRCd itself spawns live])

View File

@ -3,6 +3,7 @@
* Copyright (C) 2000-2002 Hybrid Development Team * Copyright (C) 2000-2002 Hybrid Development Team
* Copyright (C) 2002-2005 ircd-ratbox development team * Copyright (C) 2002-2005 ircd-ratbox development team
* Copyright (C) 2005-2006 charybdis 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 $ * $Id: example.conf 3582 2007-11-17 21:55:48Z jilles $
* *
@ -47,10 +48,10 @@ loadmodule "extensions/sno_globaloper.so";
#loadmodule "extensions/sno_whois.so"; #loadmodule "extensions/sno_whois.so";
serverinfo { serverinfo {
name = "hades.arpa"; name = "hostname.domain.tld";
sid = "42X"; sid = "42X";
description = "shadowircd test server"; description = "elemental-ircd test server";
network_name = "AthemeNET"; network_name = "ShadowNET";
network_desc = "Your IRC network."; network_desc = "Your IRC network.";
helpchan = "#help"; helpchan = "#help";
helpurl = "http://www.mynet.net/help"; helpurl = "http://www.mynet.net/help";
@ -90,7 +91,7 @@ serverinfo {
admin { admin {
name = "Lazy admin (lazya)"; name = "Lazy admin (lazya)";
description = "AthemeNET client server"; description = "ShadowNET client server";
email = "nobody@127.0.0.1"; email = "nobody@127.0.0.1";
}; };
@ -139,7 +140,8 @@ listen {
/* defer_accept: wait for clients to send IRC handshake data before /* defer_accept: wait for clients to send IRC handshake data before
* accepting them. if you intend to use software which depends on the * accepting them. if you intend to use software which depends on the
* server replying first, such as BOPM, you should disable this feature. * server replying first, such as BOPM, you should disable this feature.
* otherwise, you probably want to leave it on. * otherwise, you probably want to leave it on. Disabling this will not
* update on a rehash.
*/ */
defer_accept = yes; defer_accept = yes;
@ -198,11 +200,6 @@ auth {
*/ */
autojoin = "#shadowircd,#test"; 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: /* Possible flags in auth:
* *
* encrypted | password is encrypted with mkpasswd * encrypted | password is encrypted with mkpasswd
@ -430,7 +427,7 @@ serverhide {
* They are used in pairs of one host/rejection reason. * They are used in pairs of one host/rejection reason.
* *
* These settings should be adequate for most networks, and are (presently) * These settings should be adequate for most networks, and are (presently)
* required for use on AthemeNet. * required for use on ShadowNet.
* *
* Word to the wise: Do not use blacklists like SPEWS for blocking IRC * Word to the wise: Do not use blacklists like SPEWS for blocking IRC
* connections. * connections.
@ -444,9 +441,6 @@ serverhide {
* ${nick} - the user's nickname * ${nick} - the user's nickname
* ${network-name} - the name of the network * ${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 { blacklist {
host = "rbl.efnetrbl.org"; host = "rbl.efnetrbl.org";
@ -455,11 +449,8 @@ blacklist {
host = "dnsbl.dronebl.org"; 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}"; 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"; host = "torexit.dan.me.uk";
# 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."; 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 = "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" { alias "NickServ" {
@ -540,7 +531,7 @@ general {
default_operstring = "is an IRC Operator"; default_operstring = "is an IRC Operator";
default_adminstring = "is a Server Administrator"; default_adminstring = "is a Server Administrator";
default_operhost = "staff.testnet.net"; #default_operhost = "staff.testnet.net";
#static_quit = "I like turtles!"; #static_quit = "I like turtles!";
servicestring = "is a Network Service"; servicestring = "is a Network Service";
disable_fake_channels = no; disable_fake_channels = no;

View File

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

View File

@ -373,11 +373,6 @@ auth {
*/ */
autojoin = "#shadowircd,#test"; 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: /* Possible flags in auth:
* *
* encrypted | password is encrypted with mkpasswd * encrypted | password is encrypted with mkpasswd
@ -967,9 +962,6 @@ serverhide {
* ${nick} - the user's nickname * ${nick} - the user's nickname
* ${network-name} - the name of the network * ${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 { blacklist {
host = "rbl.efnetrbl.org"; host = "rbl.efnetrbl.org";
@ -977,12 +969,6 @@ blacklist {
host = "dnsbl.dronebl.org"; 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}"; 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,11 +376,6 @@ auth {
*/ */
autojoin = "#shadowircd,#test"; 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: /* Possible flags in auth:
* *
* encrypted | password is encrypted with mkpasswd * encrypted | password is encrypted with mkpasswd
@ -970,9 +965,6 @@ serverhide {
* ${nick} - the user's nickname * ${nick} - the user's nickname
* ${network-name} - the name of the network * ${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 { blacklist {
host = "rbl.efnetrbl.org"; host = "rbl.efnetrbl.org";
@ -980,12 +972,6 @@ blacklist {
host = "dnsbl.dronebl.org"; 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}"; 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,3 +52,17 @@ 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 additional actions (such as `AKILL`s or logging to channels) as needed by the
bot author. 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,6 +53,7 @@ SRCS = \
force_user_invis.c \ force_user_invis.c \
hurt.c \ hurt.c \
ip_cloaking.c \ ip_cloaking.c \
ip_cloaking-5.c \
sno_farconnect.c \ sno_farconnect.c \
sno_globalkline.c \ sno_globalkline.c \
sno_globaloper.c \ sno_globaloper.c \

View File

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

View File

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

View File

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

View File

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

View File

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

160
extensions/ip_cloaking-5.c Normal file
View File

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

View File

@ -14,7 +14,8 @@ static int mclient_42(struct Client *client_p, struct Client *source_p, int parc
struct Message hgtg_msgtab = { struct Message hgtg_msgtab = {
"42", 0, 0, 0, MFLG_SLOW, "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,8 +58,7 @@ DECLARE_MODULE_AV1(adminwall, NULL, NULL, adminwall_clist, NULL, NULL, "$Revisio
static int static int
mo_adminwall(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) 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), sendto_one(source_p, form_str(ERR_NOPRIVS),
me.name, source_p->name, "adminwall"); me.name, source_p->name, "adminwall");
return 0; return 0;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -26,8 +26,7 @@ h_nl_umode_changed(hook_data_umode_changed *hdata)
{ {
struct Client *source_p = hdata->client; 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; source_p->umodes &= ~UMODE_LOCOPS;
} }
} }

View File

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

View File

@ -34,27 +34,20 @@ h_gla_client_exit(hook_data_client_exit *hdata)
if (MyConnect(source_p) || !IsClient(source_p)) if (MyConnect(source_p) || !IsClient(source_p))
return; 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, sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
"XLINE active for %s[%s@%s]", "XLINE active for %s[%s@%s]",
source_p->name, source_p->username, source_p->host); source_p->name, source_p->username, source_p->host);
} } else if (ConfigFileEntry.kline_reason != NULL &&
else if (ConfigFileEntry.kline_reason != NULL && !strcmp(hdata->comment, ConfigFileEntry.kline_reason)) {
!strcmp(hdata->comment, ConfigFileEntry.kline_reason))
{
sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr, sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
"K/DLINE active for %s[%s@%s]", "K/DLINE active for %s[%s@%s]",
source_p->name, source_p->username, source_p->host); 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, sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
"K/DLINE active for %s[%s@%s]", "K/DLINE active for %s[%s@%s]",
source_p->name, source_p->username, source_p->host); 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, sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
"K/DLINE active for %s[%s@%s]", "K/DLINE active for %s[%s@%s]",
source_p->name, source_p->username, source_p->host); source_p->name, source_p->username, source_p->host);

View File

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

View File

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

3
extra/runit/run Executable file
View File

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

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,414 @@
/* 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

@ -0,0 +1,125 @@
/*
* 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,6 +26,8 @@ NO PARAMETERS:
weakens +i control. weakens +i control.
+z - Op moderated. Messages blocked by +m, +b and +q are instead +z - Op moderated. Messages blocked by +m, +b and +q are instead
sent to ops. 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. * +L - Large ban list. Increase maximum number of +beIq entries.
* +P - Permanent. Channel does not disappear when empty. * +P - Permanent. Channel does not disappear when empty.
+F - Free target. Anyone may set forwards to this (otherwise +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 - Send a message to users matching the
hostmask specified. hostmask specified.
These two are operator only. These two require Oper Priv: oper:mass_notice
The nick can be extended to fit into the following The nick can be extended to fit into the following
syntax: syntax:

View File

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

View File

@ -25,4 +25,6 @@ User modes: (* designates that the umode is oper only)
+G - "soft caller id" mode - same as +g but automatically allows +G - "soft caller id" mode - same as +g but automatically allows
anyone who's in a common channel with you to message you. anyone who's in a common channel with you to message you.
+V - Prevents you from receiving invites. +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). +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. Server sent WALLOPS go to all opers who are umode +w.
- Requires Oper Priv: oper:operwall - Requires Oper Priv: oper:mass_notice

View File

@ -24,6 +24,8 @@ NO PARAMETERS:
change nick. change nick.
+g - Free invite. Everyone may invite users. Significantly +g - Free invite. Everyone may invite users. Significantly
weakens +i control. 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 +z - Op moderated. Messages blocked by +m, +b and +q are instead
sent to ops. sent to ops.
* +L - Large ban list. Increase maximum number of +beIq entries. * +L - Large ban list. Increase maximum number of +beIq entries.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -94,7 +94,7 @@
#endif #endif
#define HOSTLEN 63 /* Length of hostname. Updated to */ #define HOSTLEN 63 /* Length of hostname. Updated to */
/* comply with RFC1123 */ /* comply with RFC1123 */
#define USERLEN 10 #define USERLEN 10
#define REALLEN 50 #define REALLEN 50

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -39,8 +39,7 @@ struct Client;
/* /*
* statistics structures * statistics structures
*/ */
struct ServerStatistics struct ServerStatistics {
{
unsigned int is_cl; /* number of client connections */ unsigned int is_cl; /* number of client connections */
unsigned int is_sv; /* number of server connections */ unsigned int is_sv; /* number of server connections */
unsigned int is_ni; /* connection but no idea who it was */ 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 */ /* Directory where binaries the IRCd itself spawns live */
#undef PKGLIBEXECDIR #undef PKGLIBEXECDIR
/* Directory in which to store state, such as band database */ /* Directory in which to store state, such as ban database */
#undef PKGLOCALSTATEDIR #undef PKGLOCALSTATEDIR
/* Directory to store pidfile in. */ /* Directory to store pidfile in. */

View File

@ -39,7 +39,7 @@
# include <alloca.h> # include <alloca.h>
# else # else
# ifdef _AIX # ifdef _AIX
#pragma alloca #pragma alloca
# else # else
# ifndef alloca /* predefined by HP cc +Olibcalls */ # ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca (); char *alloca ();

View File

@ -45,8 +45,7 @@ struct Client;
also removed away information. *tough* also removed away information. *tough*
- Dianora - Dianora
*/ */
struct Whowas struct Whowas {
{
int hashv; int hashv;
char name[NICKLEN + 1]; char name[NICKLEN + 1];
char username[USERLEN + 1]; char username[USERLEN + 1];
@ -93,8 +92,8 @@ void off_history(struct Client *);
** one found... ** one found...
*/ */
struct Client *get_history(const char *, time_t); struct Client *get_history(const char *, time_t);
/* Nick name */ /* Nick name */
/* Time limit in seconds */ /* Time limit in seconds */
/* /*
** for debugging...counts related structures stored in whowas array. ** for debugging...counts related structures stored in whowas array.

View File

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

997
libratbox/aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

347
libratbox/compile Executable file
View File

@ -0,0 +1,347 @@
#! /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:

830
libratbox/configure vendored

File diff suppressed because it is too large Load Diff

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