Compare commits
48 Commits
ihw
...
armageddon
Author | SHA1 | Date |
---|---|---|
|
a99df1c02c | |
|
1ac5b0570e | |
|
63a50eaabc | |
|
ee03711af4 | |
|
e862c03515 | |
|
7cfa92c570 | |
|
eda8b64bd6 | |
|
8ea110ad78 | |
|
79a3bf79ae | |
|
05b16194a3 | |
|
cf6fdf5e76 | |
|
5ba9c76d22 | |
|
dd021e6449 | |
|
bd91ef662b | |
|
219934c7ce | |
|
1bb06bb3d0 | |
|
cb1ff884a1 | |
|
bfac4f3498 | |
|
095d9fdd1a | |
|
7d3966bc9b | |
|
b1bd65b6ab | |
|
46bf689e52 | |
|
22db314d25 | |
|
9890a48cd9 | |
|
4c0924c242 | |
|
0cea0c17d2 | |
|
027b2310ca | |
|
923cda96ff | |
|
13221ce579 | |
|
379a56e808 | |
|
e12b8a2631 | |
|
4810e6a8d4 | |
|
0ae1f793d9 | |
|
e0489d0eec | |
|
4d07bf5c59 | |
|
47130005ae | |
|
26005c6f48 | |
|
6a55b37bd9 | |
|
e05337fa2e | |
|
3c7006c286 | |
|
fb096745d8 | |
|
fdd6c2721a | |
|
263bc51300 | |
|
990a42b71b | |
|
19d656a29b | |
|
d726cc83a2 | |
|
8036a22c25 | |
|
050ea2b809 |
|
@ -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'
|
|
@ -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"
|
|
@ -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
15
CREDITS
|
@ -1,14 +1,23 @@
|
|||
$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
|
||||
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>
|
||||
lyska, Sam Dodrill <shadowh511 -at- gmail.com>>
|
||||
Kabaka, Kyle Johnson <kabaka -at- ponychat.net>
|
||||
Xe, Sam Dodrill <shadowh511 -at- gmail.com>
|
||||
|
||||
ShadowIRCd 6 is a modern restart of the old ShadowIRCd project
|
||||
based on Charybdis with a few additional features to make it appeal
|
||||
|
|
103
Config
103
Config
|
@ -8,21 +8,10 @@ This software is under GPL.
|
|||
|
||||
from os import system
|
||||
|
||||
def promptUser(prompt, default):
|
||||
inp = raw_input("%s [%s]> " % (prompt, default))
|
||||
|
||||
if inp == "":
|
||||
return default
|
||||
else:
|
||||
return inp
|
||||
|
||||
def promptYesNo(prompt, default=True):
|
||||
inp = False if promptUser(prompt, "Y") == "N" else True
|
||||
return inp
|
||||
|
||||
configflags = ["./configure"]
|
||||
|
||||
system("clear")
|
||||
try:
|
||||
raw_input = raw_input
|
||||
except NameError:
|
||||
raw_input = input
|
||||
|
||||
art = """
|
||||
_______ __ __ __ _______ ______ ______ __
|
||||
|
@ -35,49 +24,62 @@ Welcome to the Elemental-IRCd Configuration script. This script will help you ch
|
|||
best compile flags for your installation of Elemental-IRCd.
|
||||
"""
|
||||
|
||||
print(art)
|
||||
print(welcome)
|
||||
class Configure():
|
||||
def promptUser(self, prompt, default):
|
||||
inp = raw_input("%s [%s]> " % (prompt, default))
|
||||
if inp == "":
|
||||
return default
|
||||
return inp
|
||||
|
||||
print("Please specify where you would like to install Elemental-IRCd.")
|
||||
installloc = promptUser("Install location?", "$HOME/ircd")
|
||||
def promptYesNo(self, prompt, defult=True):
|
||||
inp = False if self.promptUser(prompt, "Y") == "N" else True
|
||||
return inp
|
||||
|
||||
print("")
|
||||
def go(self):
|
||||
configflags = ["./configure"]
|
||||
print(art)
|
||||
print(welcome)
|
||||
|
||||
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.")
|
||||
print("Please specify where you would like to install Elemental-IRCd.")
|
||||
installloc = self.promptUser("Install location?", "$HOME/ircd")
|
||||
|
||||
nicklen = 100
|
||||
while nicklen > 51:
|
||||
if nicklen != 100:
|
||||
print "Error: you must choose a value under 50."
|
||||
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 = int(promptUser("Maximum nickname length?", "31"))
|
||||
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
|
||||
|
||||
print("")
|
||||
if not nicklen_valid:
|
||||
print("Error: you must choose an integer value under 50.")
|
||||
|
||||
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.")
|
||||
print("")
|
||||
|
||||
smallnet = promptYesNo("Small network? (Y/N)")
|
||||
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("--prefix=%s" % installloc)
|
||||
configflags.append("--with-nicklen=%s" % nicklen)
|
||||
if not smallnet:
|
||||
configflags.append("--enable-small-net")
|
||||
else:
|
||||
else:
|
||||
configflags.append("--disable-small-net")
|
||||
|
||||
print("\nThat should be it for now. Running %s" % " ".join(configflags))
|
||||
print("\nThat should be it for now. Running %s" % " ".join(configflags))
|
||||
raw_input("Press enter to continue... ")
|
||||
system(" ".join(configflags))
|
||||
print(art)
|
||||
|
||||
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
|
||||
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.
|
||||
|
@ -85,8 +87,13 @@ 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))
|
||||
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
|
||||
|
||||
|
|
|
@ -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
|
56
NEWS
56
NEWS
|
@ -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).
|
||||
|
||||
-- elemental-ircd 6.6.1
|
||||
|
||||
All code is now in the linux kernel coding style. Patches that do not
|
||||
follow this coding style are at risk of being rejected. It is suggested
|
||||
that your editor be set up to automatically style your code in the
|
||||
desired format. A vim resource file is provided in the repository root.
|
||||
|
||||
additions
|
||||
- automatic code styling for vim
|
||||
- Dockerfile and nightly docker builds
|
||||
- show cloaked I:Line vhost IP address remotely
|
||||
|
||||
bugfixes
|
||||
- all channel lists have their own limit instead of sharing one.
|
||||
5ba9c76d224afac877d9500d6ac1eb8f2bddd076
|
||||
- fix potential undefined behavior with m_away
|
||||
7d3966bc9bd9e9ab7833b4ecb0751671bdd085e7
|
||||
- fix Anope 2.0 protocol module
|
||||
79a3bf79ae66c43470c4bed25c33053b13a032d1
|
||||
|
||||
-- elemental-ircd 6.6
|
||||
|
||||
additions
|
||||
- add OWNER=y to 005
|
||||
- add autoconfigure script like unrealircd
|
||||
- add channel mode +u to hide banlists unless users have halfop or up
|
||||
- add modules for services packages
|
||||
- add quotes around PART reason
|
||||
- add umode +I to hide channels line from WHOIS
|
||||
- make end-user /OPER failures much more generic
|
||||
- make flooding SNOTEs global
|
||||
- show own modes in whois
|
||||
- show remote server IP addresses
|
||||
- update helpfiles to have much more up to date information
|
||||
|
||||
bugfixes
|
||||
- don't strip unicode in strip_unprintable
|
||||
- fix extended-join for remote users
|
||||
- fix null reference in away-notify
|
||||
- make genssl.sh generate ten year certs
|
||||
- merge some upstream charybdis patches
|
||||
|
||||
removals
|
||||
- remove away-notify
|
||||
- remove AHBL from default configs
|
||||
- remove m_post SNOTEs because of an upstream change
|
||||
|
||||
The official channel for Elemental-IRCd is now #elemental-ircd on
|
||||
irc.yolo-swag.com.
|
||||
|
||||
-- elemental-ircd 6.5.1
|
||||
|
||||
Rename to Elemental-IRCd
|
||||
|
||||
-- ponychat-ircd 6.5
|
||||
|
||||
additions
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
# Elemental-IRCd
|
||||
|
||||
# This is the IRCHighway branch. This will not link to other Elemental-IRCd instances without the specific patches in this version.
|
||||
|
||||
# YOU WILL NOT GET SUPPORT FOR THIS BRANCH. DO NOT ASK.
|
||||
|
||||
**Elemental-IRCd** is a high performance, lightweight, and scalable
|
||||
IRC daemon. It is a fork of the now-defunct ShadowIRCD and seeks to continue in
|
||||
the direction ShadowIRCD was headed.
|
||||
|
|
|
@ -1,22 +1,6 @@
|
|||
# TODO
|
||||
|
||||
## elemental-ircd 6.5.2
|
||||
|
||||
- [ ] Fix `extended-join` not triggering for users on other servers
|
||||
- [x] Patch `m_sasl`, http://seclists.org/fulldisclosure/2014/Mar/320
|
||||
- [x] Fix null reference in `src/channel.c`
|
||||
- [x] Add basic autoconfiguration script
|
||||
- [x] Add modules for services packages
|
||||
- [x] Make end user oper failures more generic
|
||||
- [x] Add `OWNER=` to `005`
|
||||
- [x] Show own modes in a `WHOIS`
|
||||
- [x] Remove AHBL blacklists from default configs
|
||||
- [x] Remove `SNOTE`s in `m_post`
|
||||
- [x] Make flooding `SNOTE`s global
|
||||
- [x] Add quotes around `PART` reason
|
||||
- [x] Disable `away-notify` for now
|
||||
|
||||
## elemental-ircd 6.6
|
||||
## elemental-ircd 6.7
|
||||
|
||||
- [ ] Finish websocket support
|
||||
- [x] Configuration for websocket ports
|
||||
|
|
|
@ -40,8 +40,7 @@
|
|||
|
||||
#define COMMIT_INTERVAL 3 /* seconds */
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
BANDB_KLINE,
|
||||
BANDB_DLINE,
|
||||
BANDB_XLINE,
|
||||
|
@ -81,12 +80,10 @@ parse_ban(bandb_type type, char *parv[], int parc)
|
|||
const char *perm = NULL;
|
||||
int para = 1;
|
||||
|
||||
if(type == BANDB_KLINE)
|
||||
{
|
||||
if(type == BANDB_KLINE) {
|
||||
if(parc != 7)
|
||||
return;
|
||||
}
|
||||
else if(parc != 6)
|
||||
} else if(parc != 6)
|
||||
return;
|
||||
|
||||
mask1 = parv[para++];
|
||||
|
@ -99,8 +96,7 @@ parse_ban(bandb_type type, char *parv[], int parc)
|
|||
perm = parv[para++];
|
||||
reason = parv[para++];
|
||||
|
||||
if(!in_transaction)
|
||||
{
|
||||
if(!in_transaction) {
|
||||
rsdb_transaction(RSDB_TRANS_START);
|
||||
in_transaction = 1;
|
||||
rb_event_addonce("bandb_commit", bandb_commit, NULL,
|
||||
|
@ -118,12 +114,10 @@ parse_unban(bandb_type type, char *parv[], int parc)
|
|||
const char *mask1 = NULL;
|
||||
const char *mask2 = NULL;
|
||||
|
||||
if(type == BANDB_KLINE)
|
||||
{
|
||||
if(type == BANDB_KLINE) {
|
||||
if(parc != 3)
|
||||
return;
|
||||
}
|
||||
else if(parc != 2)
|
||||
} else if(parc != 2)
|
||||
return;
|
||||
|
||||
mask1 = parv[1];
|
||||
|
@ -131,8 +125,7 @@ parse_unban(bandb_type type, char *parv[], int parc)
|
|||
if(type == BANDB_KLINE)
|
||||
mask2 = parv[2];
|
||||
|
||||
if(!in_transaction)
|
||||
{
|
||||
if(!in_transaction) {
|
||||
rsdb_transaction(RSDB_TRANS_START);
|
||||
in_transaction = 1;
|
||||
rb_event_addonce("bandb_commit", bandb_commit, NULL,
|
||||
|
@ -153,19 +146,17 @@ list_bans(void)
|
|||
/* schedule a clear of anything already pending */
|
||||
rb_helper_write_queue(bandb_helper, "C");
|
||||
|
||||
for(i = 0; i < LAST_BANDB_TYPE; i++)
|
||||
{
|
||||
for(i = 0; i < LAST_BANDB_TYPE; i++) {
|
||||
rsdb_exec_fetch(&table, "SELECT mask1,mask2,oper,reason FROM %s WHERE 1",
|
||||
bandb_table[i]);
|
||||
|
||||
for(j = 0; j < table.row_count; j++)
|
||||
{
|
||||
for(j = 0; j < table.row_count; j++) {
|
||||
if(i == BANDB_KLINE)
|
||||
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],
|
||||
table.row[j][1], table.row[j][2], table.row[j][3]);
|
||||
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],
|
||||
table.row[j][2], table.row[j][3]);
|
||||
|
||||
|
@ -187,15 +178,13 @@ parse_request(rb_helper *helper)
|
|||
int len;
|
||||
|
||||
|
||||
while((len = rb_helper_read(helper, readbuf, sizeof(readbuf))) > 0)
|
||||
{
|
||||
while((len = rb_helper_read(helper, readbuf, sizeof(readbuf))) > 0) {
|
||||
parc = rb_string_to_array(readbuf, parv, MAXPARA);
|
||||
|
||||
if(parc < 1)
|
||||
continue;
|
||||
|
||||
switch (parv[0][0])
|
||||
{
|
||||
switch (parv[0][0]) {
|
||||
case 'K':
|
||||
parse_ban(BANDB_KLINE, parv, parc);
|
||||
break;
|
||||
|
@ -288,7 +277,7 @@ static void
|
|||
db_error_cb(const char *errstr)
|
||||
{
|
||||
char buf[256];
|
||||
rb_snprintf(buf, sizeof(buf), "! :%s", errstr);
|
||||
snprintf(buf, sizeof(buf), "! :%s", errstr);
|
||||
rb_helper_write(bandb_helper, buf);
|
||||
rb_sleep(2 << 30, 0);
|
||||
exit(1);
|
||||
|
@ -299,8 +288,7 @@ main(int argc, char *argv[])
|
|||
{
|
||||
setup_signals();
|
||||
bandb_helper = rb_helper_child(parse_request, error_cb, NULL, NULL, NULL, 256, 256, 256, 256); /* XXX fix me */
|
||||
if(bandb_helper == NULL)
|
||||
{
|
||||
if(bandb_helper == NULL) {
|
||||
fprintf(stderr,
|
||||
"This is ircd-ratbox bandb. You aren't supposed to run me directly. Maybe you want bantool?\n");
|
||||
fprintf(stderr,
|
||||
|
@ -321,8 +309,7 @@ check_schema(void)
|
|||
struct rsdb_table table;
|
||||
int i;
|
||||
|
||||
for(i = 0; i < LAST_BANDB_TYPE; i++)
|
||||
{
|
||||
for(i = 0; i < LAST_BANDB_TYPE; i++) {
|
||||
rsdb_exec_fetch(&table,
|
||||
"SELECT name FROM sqlite_master WHERE type='table' AND name='%s'",
|
||||
bandb_table[i]);
|
||||
|
|
154
bandb/bantool.c
154
bandb/bantool.c
|
@ -51,8 +51,7 @@
|
|||
|
||||
#define BT_VERSION "0.4.1"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
BANDB_KLINE,
|
||||
BANDB_KLINE_PERM,
|
||||
BANDB_DLINE,
|
||||
|
@ -84,8 +83,7 @@ static char me[PATH_MAX];
|
|||
|
||||
/* *INDENT-OFF* */
|
||||
/* report counters */
|
||||
struct counter
|
||||
{
|
||||
struct counter {
|
||||
unsigned int klines;
|
||||
unsigned int dlines;
|
||||
unsigned int xlines;
|
||||
|
@ -94,8 +92,7 @@ struct counter
|
|||
} count = {0, 0, 0, 0, 0};
|
||||
|
||||
/* flags set by command line options */
|
||||
struct flags
|
||||
{
|
||||
struct flags {
|
||||
int none;
|
||||
int export;
|
||||
int import;
|
||||
|
@ -140,10 +137,8 @@ main(int argc, char *argv[])
|
|||
|
||||
rb_strlcpy(me, argv[0], sizeof(me));
|
||||
|
||||
while((opt = getopt(argc, argv, "hieuspvwd")) != -1)
|
||||
{
|
||||
switch (opt)
|
||||
{
|
||||
while((opt = getopt(argc, argv, "hieuspvwd")) != -1) {
|
||||
switch (opt) {
|
||||
case 'h':
|
||||
print_help(EXIT_SUCCESS);
|
||||
break;
|
||||
|
@ -185,8 +180,7 @@ main(int argc, char *argv[])
|
|||
print_help(EXIT_FAILURE);
|
||||
|
||||
if((flag.import && flag.export) || (flag.export && flag.wipe)
|
||||
|| (flag.verify && flag.pretend) || (flag.export && flag.pretend))
|
||||
{
|
||||
|| (flag.verify && flag.pretend) || (flag.export && flag.pretend)) {
|
||||
fprintf(stderr, "* Error: Conflicting flags.\n");
|
||||
if(flag.export && flag.pretend)
|
||||
fprintf(stderr, "* There is nothing to 'pretend' when exporting.\n");
|
||||
|
@ -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",
|
||||
BT_VERSION);
|
||||
|
||||
if(flag.pretend == NO)
|
||||
{
|
||||
if(rsdb_init(db_error_cb) == -1)
|
||||
{
|
||||
if(flag.pretend == NO) {
|
||||
if(rsdb_init(db_error_cb) == -1) {
|
||||
fprintf(stderr, "* Error: Unable to open database\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
@ -216,8 +208,7 @@ main(int argc, char *argv[])
|
|||
if(flag.vacuum)
|
||||
db_reclaim_slack();
|
||||
|
||||
if(flag.import && flag.wipe)
|
||||
{
|
||||
if(flag.import && flag.wipe) {
|
||||
flag.dupes_ok = YES; /* dont check for dupes if we are wiping the db clean */
|
||||
for(i = 0; i < 3; i++)
|
||||
fprintf(stdout,
|
||||
|
@ -234,9 +225,8 @@ main(int argc, char *argv[])
|
|||
fprintf(stdout, "* Allowing duplicate bans...\n");
|
||||
|
||||
/* checking for our files to import or export */
|
||||
for(i = 0; i < LAST_BANDB_TYPE; i++)
|
||||
{
|
||||
rb_snprintf(conf, sizeof(conf), "%s/%s.conf%s",
|
||||
for(i = 0; i < LAST_BANDB_TYPE; i++) {
|
||||
snprintf(conf, sizeof(conf), "%s/%s.conf%s",
|
||||
etc, bandb_table[i], bandb_suffix[i]);
|
||||
|
||||
if(flag.import && flag.pretend == NO)
|
||||
|
@ -252,8 +242,7 @@ main(int argc, char *argv[])
|
|||
rsdb_transaction(RSDB_TRANS_END);
|
||||
}
|
||||
|
||||
if(flag.import)
|
||||
{
|
||||
if(flag.import) {
|
||||
if(count.error && flag.verbose)
|
||||
fprintf(stderr, "* I was unable to locate %i config files to import.\n",
|
||||
count.error);
|
||||
|
@ -297,17 +286,16 @@ export_config(const char *conf, int id)
|
|||
return;
|
||||
|
||||
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",
|
||||
bandb_table[id]);
|
||||
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",
|
||||
bandb_table[id]);
|
||||
|
||||
rsdb_exec_fetch(&table, sql);
|
||||
if(table.row_count <= 0)
|
||||
{
|
||||
if(table.row_count <= 0) {
|
||||
rsdb_exec_fetch_end(&table);
|
||||
return;
|
||||
}
|
||||
|
@ -316,21 +304,18 @@ export_config(const char *conf, int id)
|
|||
fprintf(stdout, "* checking for %s: ", conf); /* debug */
|
||||
|
||||
/* open config for reading, or skip to the next */
|
||||
if(!(fd = fopen(conf, "w")))
|
||||
{
|
||||
if(!(fd = fopen(conf, "w"))) {
|
||||
if(flag.verbose)
|
||||
fprintf(stdout, "\tmissing.\n");
|
||||
count.error++;
|
||||
return;
|
||||
}
|
||||
|
||||
for(j = 0; j < table.row_count; j++)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
for(j = 0; j < table.row_count; j++) {
|
||||
switch (id) {
|
||||
case BANDB_DLINE:
|
||||
case BANDB_DLINE_PERM:
|
||||
rb_snprintf(buf, sizeof(buf),
|
||||
snprintf(buf, sizeof(buf),
|
||||
"\"%s\",\"%s\",\"\",\"%s\",\"%s\",%s\n",
|
||||
table.row[j][mask1],
|
||||
mangle_reason(table.row[j][reason]),
|
||||
|
@ -340,7 +325,7 @@ export_config(const char *conf, int id)
|
|||
|
||||
case BANDB_XLINE:
|
||||
case BANDB_XLINE_PERM:
|
||||
rb_snprintf(buf, sizeof(buf),
|
||||
snprintf(buf, sizeof(buf),
|
||||
"\"%s\",\"0\",\"%s\",\"%s\",%s\n",
|
||||
escape_quotes(table.row[j][mask1]),
|
||||
mangle_reason(table.row[j][reason]),
|
||||
|
@ -349,7 +334,7 @@ export_config(const char *conf, int id)
|
|||
|
||||
case BANDB_RESV:
|
||||
case BANDB_RESV_PERM:
|
||||
rb_snprintf(buf, sizeof(buf),
|
||||
snprintf(buf, sizeof(buf),
|
||||
"\"%s\",\"%s\",\"%s\",%s\n",
|
||||
table.row[j][mask1],
|
||||
mangle_reason(table.row[j][reason]),
|
||||
|
@ -358,7 +343,7 @@ export_config(const char *conf, int id)
|
|||
|
||||
|
||||
default: /* Klines */
|
||||
rb_snprintf(buf, sizeof(buf),
|
||||
snprintf(buf, sizeof(buf),
|
||||
"\"%s\",\"%s\",\"%s\",\"\",\"%s\",\"%s\",%s\n",
|
||||
table.row[j][mask1], table.row[j][mask2],
|
||||
mangle_reason(table.row[j][reason]),
|
||||
|
@ -401,8 +386,7 @@ import_config(const char *conf, int id)
|
|||
fprintf(stdout, "* checking for %s: ", conf); /* debug */
|
||||
|
||||
/* open config for reading, or skip to the next */
|
||||
if(!(fd = fopen(conf, "r")))
|
||||
{
|
||||
if(!(fd = fopen(conf, "r"))) {
|
||||
if(flag.verbose)
|
||||
fprintf(stdout, "%*s", strlen(bandb_suffix[id]) > 0 ? 10 : 15,
|
||||
"missing.\n");
|
||||
|
@ -421,8 +405,7 @@ import_config(const char *conf, int id)
|
|||
* dline
|
||||
* "194.158.192.0/19","laptop scammers","","2005/3/17 05.33","stevoo!stevoo@efnet.port80.se{stevoo}",1111033988
|
||||
*/
|
||||
while(fgets(line, sizeof(line), fd))
|
||||
{
|
||||
while(fgets(line, sizeof(line), fd)) {
|
||||
if((p = strpbrk(line, "\r\n")) != NULL)
|
||||
*p = '\0';
|
||||
|
||||
|
@ -436,8 +419,7 @@ import_config(const char *conf, int id)
|
|||
continue;
|
||||
|
||||
/* mask2 */
|
||||
switch (id)
|
||||
{
|
||||
switch (id) {
|
||||
case BANDB_XLINE:
|
||||
case BANDB_XLINE_PERM:
|
||||
f_mask1 = escape_quotes(clean_gecos_field(f_mask1));
|
||||
|
@ -463,8 +445,7 @@ import_config(const char *conf, int id)
|
|||
continue;
|
||||
|
||||
/* oper comment */
|
||||
switch (id)
|
||||
{
|
||||
switch (id) {
|
||||
case BANDB_KLINE:
|
||||
case BANDB_KLINE_PERM:
|
||||
case BANDB_DLINE:
|
||||
|
@ -483,10 +464,8 @@ import_config(const char *conf, int id)
|
|||
f_oper = "unknown";
|
||||
|
||||
/* meh */
|
||||
if(id == BANDB_KLINE || id == BANDB_KLINE_PERM)
|
||||
{
|
||||
if(strstr(f_mask1, "!") != NULL)
|
||||
{
|
||||
if(id == BANDB_KLINE || id == BANDB_KLINE_PERM) {
|
||||
if(strstr(f_mask1, "!") != NULL) {
|
||||
fprintf(stderr,
|
||||
"* SKIPPING INVALID KLINE %s@%s set by %s\n",
|
||||
f_mask1, f_mask2, f_oper);
|
||||
|
@ -497,12 +476,11 @@ import_config(const char *conf, int id)
|
|||
|
||||
/* append operreason_field to reason_field */
|
||||
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
|
||||
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)
|
||||
drop_dupes(f_mask1, f_mask2, bandb_table[id]);
|
||||
|
||||
|
@ -521,8 +499,7 @@ import_config(const char *conf, int id)
|
|||
i++;
|
||||
}
|
||||
|
||||
switch (bandb_letter[id])
|
||||
{
|
||||
switch (bandb_letter[id]) {
|
||||
case 'K':
|
||||
count.klines += i;
|
||||
break;
|
||||
|
@ -574,27 +551,20 @@ getfield(char *newline)
|
|||
|
||||
end = strchr(line, ',');
|
||||
|
||||
while(1)
|
||||
{
|
||||
while(1) {
|
||||
/* no trailing , - last field */
|
||||
if(end == NULL)
|
||||
{
|
||||
if(end == NULL) {
|
||||
end = line + strlen(line);
|
||||
line = NULL;
|
||||
|
||||
if(*end == '"')
|
||||
{
|
||||
if(*end == '"') {
|
||||
*end = '\0';
|
||||
return field;
|
||||
}
|
||||
else
|
||||
} else
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
/* look for a ", to mark the end of a field.. */
|
||||
if(*(end - 1) == '"')
|
||||
{
|
||||
if(*(end - 1) == '"') {
|
||||
line = end + 1;
|
||||
end--;
|
||||
*end = '\0';
|
||||
|
@ -622,10 +592,8 @@ strip_quotes(const char *string)
|
|||
if(string == NULL)
|
||||
return NULL;
|
||||
|
||||
while(*string)
|
||||
{
|
||||
if(*string != '"')
|
||||
{
|
||||
while(*string) {
|
||||
if(*string != '"') {
|
||||
*str++ = *string;
|
||||
}
|
||||
string++;
|
||||
|
@ -646,15 +614,11 @@ escape_quotes(const char *string)
|
|||
if(string == NULL)
|
||||
return NULL;
|
||||
|
||||
while(*string)
|
||||
{
|
||||
if(*string == '"')
|
||||
{
|
||||
while(*string) {
|
||||
if(*string == '"') {
|
||||
*str++ = '\\';
|
||||
*str++ = '"';
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
*str++ = *string;
|
||||
}
|
||||
string++;
|
||||
|
@ -673,10 +637,8 @@ mangle_reason(const char *string)
|
|||
if(string == NULL)
|
||||
return NULL;
|
||||
|
||||
while(*string)
|
||||
{
|
||||
switch (*string)
|
||||
{
|
||||
while(*string) {
|
||||
switch (*string) {
|
||||
case '"':
|
||||
*str = '\'';
|
||||
break;
|
||||
|
@ -707,14 +669,11 @@ clean_gecos_field(const char *gecos)
|
|||
if(gecos == NULL)
|
||||
return NULL;
|
||||
|
||||
while(*gecos)
|
||||
{
|
||||
if(*gecos == ' ')
|
||||
{
|
||||
while(*gecos) {
|
||||
if(*gecos == ' ') {
|
||||
*str++ = '\\';
|
||||
*str++ = 's';
|
||||
}
|
||||
else
|
||||
} else
|
||||
*str++ = *gecos;
|
||||
gecos++;
|
||||
}
|
||||
|
@ -744,10 +703,8 @@ check_schema(void)
|
|||
NULL
|
||||
};
|
||||
|
||||
for(i = 0; i < LAST_BANDB_TYPE; i++)
|
||||
{
|
||||
if(!table_exists(bandb_table[i]))
|
||||
{
|
||||
for(i = 0; i < LAST_BANDB_TYPE; i++) {
|
||||
if(!table_exists(bandb_table[i])) {
|
||||
rsdb_exec(NULL,
|
||||
"CREATE TABLE %s (mask1 TEXT, mask2 TEXT, oper TEXT, time INTEGER, perm INTEGER, reason TEXT)",
|
||||
bandb_table[i]);
|
||||
|
@ -757,10 +714,8 @@ check_schema(void)
|
|||
* i can't think of any better way to do this, other then attempt to
|
||||
* force the creation of column that may, or may not already exist. --dubkat
|
||||
*/
|
||||
else
|
||||
{
|
||||
for(j = 0; columns[j] != NULL; j++)
|
||||
{
|
||||
else {
|
||||
for(j = 0; columns[j] != NULL; j++) {
|
||||
if(!strcmp(columns[j], "time") && !strcmp(columns[j], "perm"))
|
||||
rb_strlcpy(type, "INTEGER", sizeof(type));
|
||||
else
|
||||
|
@ -817,8 +772,7 @@ wipe_schema(void)
|
|||
{
|
||||
int i;
|
||||
rsdb_transaction(RSDB_TRANS_START);
|
||||
for(i = 0; i < LAST_BANDB_TYPE; i++)
|
||||
{
|
||||
for(i = 0; i < LAST_BANDB_TYPE; i++) {
|
||||
rsdb_exec(NULL, "DROP TABLE %s", bandb_table[i]);
|
||||
i++; /* double increment to skip over .perm */
|
||||
}
|
||||
|
@ -857,7 +811,7 @@ bt_smalldate(const char *string)
|
|||
lt = gmtime(&t);
|
||||
if(lt == 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);
|
||||
return buf;
|
||||
}
|
||||
|
|
|
@ -6,15 +6,13 @@ typedef void rsdb_error_cb(const char *);
|
|||
|
||||
typedef int (*rsdb_callback) (int, const char **);
|
||||
|
||||
typedef enum rsdb_transtype
|
||||
{
|
||||
typedef enum rsdb_transtype {
|
||||
RSDB_TRANS_START,
|
||||
RSDB_TRANS_END
|
||||
}
|
||||
rsdb_transtype;
|
||||
|
||||
struct rsdb_table
|
||||
{
|
||||
struct rsdb_table {
|
||||
char ***row;
|
||||
int row_count;
|
||||
int col_count;
|
||||
|
|
|
@ -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 maxbytes = bytes - 1;
|
||||
|
||||
while((ch = *format++) && (written < maxbytes))
|
||||
{
|
||||
if(ch == '%')
|
||||
{
|
||||
while((ch = *format++) && (written < maxbytes)) {
|
||||
if(ch == '%') {
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
if(ch == 's')
|
||||
{
|
||||
if(ch == 's') {
|
||||
const char *str = va_arg(args, const char *);
|
||||
|
||||
while((*dest = *str))
|
||||
{
|
||||
while((*dest = *str)) {
|
||||
++dest;
|
||||
++str;
|
||||
|
||||
|
@ -307,8 +303,7 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
|
|||
continue;
|
||||
}
|
||||
|
||||
if(ch == 'd')
|
||||
{
|
||||
if(ch == 'd') {
|
||||
int num = va_arg(args, int);
|
||||
int quotient;
|
||||
const char *str;
|
||||
|
@ -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
|
||||
*/
|
||||
if(num == 0)
|
||||
{
|
||||
if(num == 0) {
|
||||
*dest++ = '0';
|
||||
++written;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(num < 0)
|
||||
{
|
||||
if(num < 0) {
|
||||
*dest++ = '-';
|
||||
if(++written >= maxbytes)
|
||||
continue;
|
||||
|
@ -333,8 +326,7 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
|
|||
num = -num;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
do {
|
||||
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)];
|
||||
|
||||
while((*digitptr = *str))
|
||||
{
|
||||
while((*digitptr = *str)) {
|
||||
++digitptr;
|
||||
++str;
|
||||
}
|
||||
}
|
||||
while((num = quotient) != 0);
|
||||
} while((num = quotient) != 0);
|
||||
|
||||
/*
|
||||
* If the last quotient was a 1 or 2 digit number, there
|
||||
|
@ -385,8 +375,7 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
|
|||
while(*(digitptr - 1) == '0')
|
||||
--digitptr;
|
||||
|
||||
while(digitptr != TempBuffer)
|
||||
{
|
||||
while(digitptr != TempBuffer) {
|
||||
*dest++ = *--digitptr;
|
||||
if(++written >= maxbytes)
|
||||
break;
|
||||
|
@ -395,8 +384,7 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
|
|||
continue;
|
||||
} /* if (ch == 'd') */
|
||||
|
||||
if(ch == 'c')
|
||||
{
|
||||
if(ch == 'c') {
|
||||
*dest++ = va_arg(args, int);
|
||||
|
||||
++written;
|
||||
|
@ -404,22 +392,19 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
|
|||
continue;
|
||||
} /* if (ch == 'c') */
|
||||
|
||||
if(ch == 'u')
|
||||
{
|
||||
if(ch == 'u') {
|
||||
unsigned int num = va_arg(args, unsigned int);
|
||||
unsigned int quotient;
|
||||
const char *str;
|
||||
char *digitptr = TempBuffer;
|
||||
|
||||
if(num == 0)
|
||||
{
|
||||
if(num == 0) {
|
||||
*dest++ = '0';
|
||||
++written;
|
||||
continue;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
do {
|
||||
quotient = num / TABLE_MAX;
|
||||
|
||||
/*
|
||||
|
@ -428,19 +413,16 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
|
|||
|
||||
str = IntTable[num - (quotient * TABLE_MAX)];
|
||||
|
||||
while((*digitptr = *str))
|
||||
{
|
||||
while((*digitptr = *str)) {
|
||||
++digitptr;
|
||||
++str;
|
||||
}
|
||||
}
|
||||
while((num = quotient) != 0);
|
||||
} while((num = quotient) != 0);
|
||||
|
||||
while(*(digitptr - 1) == '0')
|
||||
--digitptr;
|
||||
|
||||
while(digitptr != TempBuffer)
|
||||
{
|
||||
while(digitptr != TempBuffer) {
|
||||
*dest++ = *--digitptr;
|
||||
if(++written >= maxbytes)
|
||||
break;
|
||||
|
@ -449,8 +431,7 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
|
|||
continue;
|
||||
} /* if (ch == 'u') */
|
||||
|
||||
if(ch == 'Q')
|
||||
{
|
||||
if(ch == 'Q') {
|
||||
const char *arg = va_arg(args, const char *);
|
||||
|
||||
if(arg == NULL)
|
||||
|
@ -458,8 +439,7 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
|
|||
|
||||
const char *str = rsdb_quote(arg);
|
||||
|
||||
while((*dest = *str))
|
||||
{
|
||||
while((*dest = *str)) {
|
||||
++dest;
|
||||
++str;
|
||||
|
||||
|
@ -470,10 +450,8 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
|
|||
continue;
|
||||
}
|
||||
|
||||
if(ch == 'l')
|
||||
{
|
||||
if(*format == 'u')
|
||||
{
|
||||
if(ch == 'l') {
|
||||
if(*format == 'u') {
|
||||
unsigned long num = va_arg(args, unsigned long);
|
||||
unsigned long quotient;
|
||||
const char *str;
|
||||
|
@ -481,15 +459,13 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
|
|||
|
||||
++format;
|
||||
|
||||
if(num == 0)
|
||||
{
|
||||
if(num == 0) {
|
||||
*dest++ = '0';
|
||||
++written;
|
||||
continue;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
do {
|
||||
quotient = num / TABLE_MAX;
|
||||
|
||||
/*
|
||||
|
@ -498,29 +474,24 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
|
|||
|
||||
str = IntTable[num - (quotient * TABLE_MAX)];
|
||||
|
||||
while((*digitptr = *str))
|
||||
{
|
||||
while((*digitptr = *str)) {
|
||||
++digitptr;
|
||||
++str;
|
||||
}
|
||||
}
|
||||
while((num = quotient) != 0);
|
||||
} while((num = quotient) != 0);
|
||||
|
||||
while(*(digitptr - 1) == '0')
|
||||
--digitptr;
|
||||
|
||||
while(digitptr != TempBuffer)
|
||||
{
|
||||
while(digitptr != TempBuffer) {
|
||||
*dest++ = *--digitptr;
|
||||
if(++written >= maxbytes)
|
||||
break;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
else
|
||||
/* if (*format == 'u') */ if(*format == 'd')
|
||||
{
|
||||
} else
|
||||
/* if (*format == 'u') */ if(*format == 'd') {
|
||||
long num = va_arg(args, long);
|
||||
long quotient;
|
||||
const char *str;
|
||||
|
@ -528,15 +499,13 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
|
|||
|
||||
++format;
|
||||
|
||||
if(num == 0)
|
||||
{
|
||||
if(num == 0) {
|
||||
*dest++ = '0';
|
||||
++written;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(num < 0)
|
||||
{
|
||||
if(num < 0) {
|
||||
*dest++ = '-';
|
||||
if(++written >= maxbytes)
|
||||
continue;
|
||||
|
@ -544,34 +513,28 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
|
|||
num = -num;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
do {
|
||||
quotient = num / TABLE_MAX;
|
||||
|
||||
str = IntTable[num - (quotient * TABLE_MAX)];
|
||||
|
||||
while((*digitptr = *str))
|
||||
{
|
||||
while((*digitptr = *str)) {
|
||||
++digitptr;
|
||||
++str;
|
||||
}
|
||||
}
|
||||
while((num = quotient) != 0);
|
||||
} while((num = quotient) != 0);
|
||||
|
||||
while(*(digitptr - 1) == '0')
|
||||
--digitptr;
|
||||
|
||||
while(digitptr != TempBuffer)
|
||||
{
|
||||
while(digitptr != TempBuffer) {
|
||||
*dest++ = *--digitptr;
|
||||
if(++written >= maxbytes)
|
||||
break;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
else /* if (*format == 'd') */
|
||||
{
|
||||
} else { /* if (*format == 'd') */
|
||||
/* XXX error */
|
||||
exit(1);
|
||||
}
|
||||
|
@ -579,8 +542,7 @@ rs_vsnprintf(char *dest, const size_t bytes, const char *format, va_list args)
|
|||
|
||||
} /* if (ch == 'l') */
|
||||
|
||||
if(ch != '%')
|
||||
{
|
||||
if(ch != '%') {
|
||||
/* XXX error */
|
||||
exit(1);
|
||||
} /* if (ch != '%') */
|
||||
|
|
|
@ -41,16 +41,14 @@ rsdb_error_cb *error_cb;
|
|||
static void
|
||||
mlog(const char *errstr, ...)
|
||||
{
|
||||
if(error_cb != NULL)
|
||||
{
|
||||
if(error_cb != NULL) {
|
||||
char buf[256];
|
||||
va_list ap;
|
||||
va_start(ap, errstr);
|
||||
rb_vsnprintf(buf, sizeof(buf), errstr, ap);
|
||||
vsnprintf(buf, sizeof(buf), errstr, ap);
|
||||
va_end(ap);
|
||||
error_cb(buf);
|
||||
}
|
||||
else
|
||||
} else
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -70,16 +68,14 @@ rsdb_init(rsdb_error_cb * ecb)
|
|||
else
|
||||
rb_strlcpy(dbpath, DBPATH, sizeof(dbpath));
|
||||
|
||||
if(sqlite3_open(dbpath, &rb_bandb) != SQLITE_OK)
|
||||
{
|
||||
rb_snprintf(errbuf, sizeof(errbuf), "Unable to open sqlite database: %s",
|
||||
if(sqlite3_open(dbpath, &rb_bandb) != SQLITE_OK) {
|
||||
snprintf(errbuf, sizeof(errbuf), "Unable to open sqlite database: %s",
|
||||
sqlite3_errmsg(rb_bandb));
|
||||
mlog(errbuf);
|
||||
return -1;
|
||||
}
|
||||
if(access(dbpath, W_OK))
|
||||
{
|
||||
rb_snprintf(errbuf, sizeof(errbuf), "Unable to open sqlite database for write: %s", strerror(errno));
|
||||
if(access(dbpath, W_OK)) {
|
||||
snprintf(errbuf, sizeof(errbuf), "Unable to open sqlite database for write: %s", strerror(errno));
|
||||
mlog(errbuf);
|
||||
return -1;
|
||||
}
|
||||
|
@ -103,8 +99,7 @@ rsdb_quote(const char *src)
|
|||
if(strlen(src) >= (sizeof(buf) / 2))
|
||||
return NULL;
|
||||
|
||||
while(*src)
|
||||
{
|
||||
while(*src) {
|
||||
if(*src == '\'')
|
||||
*p++ = '\'';
|
||||
|
||||
|
@ -136,18 +131,14 @@ rsdb_exec(rsdb_callback cb, const char *format, ...)
|
|||
i = rs_vsnprintf(buf, sizeof(buf), format, args);
|
||||
va_end(args);
|
||||
|
||||
if(i >= sizeof(buf))
|
||||
{
|
||||
if(i >= sizeof(buf)) {
|
||||
mlog("fatal error: length problem with compiling sql");
|
||||
}
|
||||
|
||||
if((i = sqlite3_exec(rb_bandb, buf, (cb ? rsdb_callback_func : NULL), (void *)((uintptr_t)cb), &errmsg)))
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
if((i = sqlite3_exec(rb_bandb, buf, (cb ? rsdb_callback_func : NULL), (void *)((uintptr_t)cb), &errmsg))) {
|
||||
switch (i) {
|
||||
case SQLITE_BUSY:
|
||||
for(j = 0; j < 5; j++)
|
||||
{
|
||||
for(j = 0; j < 5; j++) {
|
||||
rb_sleep(0, 500000);
|
||||
if(!sqlite3_exec
|
||||
(rb_bandb, buf, (cb ? rsdb_callback_func : NULL), (void *)((uintptr_t)cb), &errmsg))
|
||||
|
@ -180,26 +171,21 @@ rsdb_exec_fetch(struct rsdb_table *table, const char *format, ...)
|
|||
retval = rs_vsnprintf(buf, sizeof(buf), format, args);
|
||||
va_end(args);
|
||||
|
||||
if(retval >= sizeof(buf))
|
||||
{
|
||||
if(retval >= sizeof(buf)) {
|
||||
mlog("fatal error: length problem with compiling sql");
|
||||
}
|
||||
|
||||
if((retval =
|
||||
sqlite3_get_table(rb_bandb, buf, &data, &table->row_count, &table->col_count, &errmsg)))
|
||||
{
|
||||
sqlite3_get_table(rb_bandb, buf, &data, &table->row_count, &table->col_count, &errmsg))) {
|
||||
int success = 0;
|
||||
|
||||
switch (retval)
|
||||
{
|
||||
switch (retval) {
|
||||
case SQLITE_BUSY:
|
||||
for(i = 0; i < 5; i++)
|
||||
{
|
||||
for(i = 0; i < 5; i++) {
|
||||
rb_sleep(0, 500000);
|
||||
if(!sqlite3_get_table
|
||||
(rb_bandb, buf, &data, &table->row_count, &table->col_count,
|
||||
&errmsg))
|
||||
{
|
||||
&errmsg)) {
|
||||
success++;
|
||||
break;
|
||||
}
|
||||
|
@ -220,8 +206,7 @@ rsdb_exec_fetch(struct rsdb_table *table, const char *format, ...)
|
|||
/* we need to be able to free data afterward */
|
||||
table->arg = data;
|
||||
|
||||
if(table->row_count == 0)
|
||||
{
|
||||
if(table->row_count == 0) {
|
||||
table->row = NULL;
|
||||
return;
|
||||
}
|
||||
|
@ -229,12 +214,10 @@ rsdb_exec_fetch(struct rsdb_table *table, const char *format, ...)
|
|||
/* sqlite puts the column names as the first row */
|
||||
pos = table->col_count;
|
||||
table->row = rb_malloc(sizeof(char **) * table->row_count);
|
||||
for(i = 0; i < table->row_count; i++)
|
||||
{
|
||||
for(i = 0; i < table->row_count; i++) {
|
||||
table->row[i] = rb_malloc(sizeof(char *) * table->col_count);
|
||||
|
||||
for(j = 0; j < table->col_count; j++)
|
||||
{
|
||||
for(j = 0; j < table->col_count; j++) {
|
||||
table->row[i][j] = data[pos++];
|
||||
}
|
||||
}
|
||||
|
@ -245,8 +228,7 @@ rsdb_exec_fetch_end(struct rsdb_table *table)
|
|||
{
|
||||
int i;
|
||||
|
||||
for(i = 0; i < table->row_count; i++)
|
||||
{
|
||||
for(i = 0; i < table->row_count; i++) {
|
||||
rb_free(table->row[i]);
|
||||
}
|
||||
rb_free(table->row);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#! /bin/sh
|
||||
# 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.
|
||||
#
|
||||
# 2014 elemental-ircd Team
|
||||
#
|
||||
|
@ -579,8 +579,8 @@ MAKEFLAGS=
|
|||
# Identity of this package.
|
||||
PACKAGE_NAME='elemental-ircd'
|
||||
PACKAGE_TARNAME='elemental-ircd'
|
||||
PACKAGE_VERSION='6.5.1'
|
||||
PACKAGE_STRING='elemental-ircd 6.5.1'
|
||||
PACKAGE_VERSION='6.6.1'
|
||||
PACKAGE_STRING='elemental-ircd 6.6.1'
|
||||
PACKAGE_BUGREPORT=''
|
||||
PACKAGE_URL=''
|
||||
|
||||
|
@ -1303,7 +1303,7 @@ if test "$ac_init_help" = "long"; then
|
|||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures elemental-ircd 6.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]...
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ fi
|
|||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of elemental-ircd 6.5.1:";;
|
||||
short | recursive ) echo "Configuration of elemental-ircd 6.6.1:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
|
@ -1488,7 +1488,7 @@ fi
|
|||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
elemental-ircd configure 6.5.1
|
||||
elemental-ircd configure 6.6.1
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
|
@ -2092,7 +2092,7 @@ cat >config.log <<_ACEOF
|
|||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by elemental-ircd $as_me 6.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
|
||||
|
||||
$ $0 $@
|
||||
|
@ -10100,7 +10100,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
|||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by elemental-ircd $as_me 6.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
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
|
@ -10166,7 +10166,7 @@ _ACEOF
|
|||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
elemental-ircd config.status 6.5.1
|
||||
elemental-ircd config.status 6.6.1
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ AC_PREREQ(2.57)
|
|||
dnl Sneaky way to get an Id tag into the configure script
|
||||
AC_COPYRIGHT([2014 elemental-ircd Team])
|
||||
|
||||
AC_INIT([elemental-ircd+ihw],[6.5.2])
|
||||
AC_INIT([elemental-ircd],[6.6.1])
|
||||
|
||||
AC_CONFIG_HEADER(include/setup.h)
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2000-2002 Hybrid Development Team
|
||||
* Copyright (C) 2002-2005 ircd-ratbox development team
|
||||
* Copyright (C) 2005-2006 charybdis development team
|
||||
* Copyright (C) 2014 Elemental-IRCd development team
|
||||
*
|
||||
* $Id: example.conf 3582 2007-11-17 21:55:48Z jilles $
|
||||
*
|
||||
|
@ -47,10 +48,10 @@ loadmodule "extensions/sno_globaloper.so";
|
|||
#loadmodule "extensions/sno_whois.so";
|
||||
|
||||
serverinfo {
|
||||
name = "hades.arpa";
|
||||
name = "hostname.domain.tld";
|
||||
sid = "42X";
|
||||
description = "shadowircd test server";
|
||||
network_name = "AthemeNET";
|
||||
description = "elemental-ircd test server";
|
||||
network_name = "ShadowNET";
|
||||
network_desc = "Your IRC network.";
|
||||
helpchan = "#help";
|
||||
helpurl = "http://www.mynet.net/help";
|
||||
|
@ -90,7 +91,7 @@ serverinfo {
|
|||
|
||||
admin {
|
||||
name = "Lazy admin (lazya)";
|
||||
description = "AthemeNET client server";
|
||||
description = "ShadowNET client server";
|
||||
email = "nobody@127.0.0.1";
|
||||
};
|
||||
|
||||
|
@ -139,7 +140,8 @@ listen {
|
|||
/* defer_accept: wait for clients to send IRC handshake data before
|
||||
* accepting them. if you intend to use software which depends on the
|
||||
* server replying first, such as BOPM, you should disable this feature.
|
||||
* otherwise, you probably want to leave it on.
|
||||
* otherwise, you probably want to leave it on. Disabling this will not
|
||||
* update on a rehash.
|
||||
*/
|
||||
defer_accept = yes;
|
||||
|
||||
|
@ -425,7 +427,7 @@ serverhide {
|
|||
* They are used in pairs of one host/rejection reason.
|
||||
*
|
||||
* These settings should be adequate for most networks, and are (presently)
|
||||
* required for use on AthemeNet.
|
||||
* required for use on ShadowNet.
|
||||
*
|
||||
* Word to the wise: Do not use blacklists like SPEWS for blocking IRC
|
||||
* connections.
|
||||
|
@ -446,6 +448,9 @@ blacklist {
|
|||
|
||||
host = "dnsbl.dronebl.org";
|
||||
reject_reason = "${nick}, your IP (${ip}) is listed in DroneBL. For assistance, see http://dronebl.org/lookup_branded.do?ip=${ip}&network=${network-name}";
|
||||
|
||||
host = "torexit.dan.me.uk";
|
||||
reject_reason = "${nick}, your IP (${ip}) is listed as a TOR exit node. In order to protect ${network-name} from TOR-based abuse, we are not allowing TOR exit nodes to connect to our network.";
|
||||
};
|
||||
|
||||
alias "NickServ" {
|
||||
|
@ -526,7 +531,7 @@ general {
|
|||
|
||||
default_operstring = "is an IRC Operator";
|
||||
default_adminstring = "is a Server Administrator";
|
||||
default_operhost = "staff.testnet.net";
|
||||
#default_operhost = "staff.testnet.net";
|
||||
#static_quit = "I like turtles!";
|
||||
servicestring = "is a Network Service";
|
||||
disable_fake_channels = no;
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
This is ShadowIRCd MOTD. You might replace it, but if not, your friends will
|
||||
laugh at you.
|
||||
This is the Elemental-IRCd MOTD. You can use this if you like;
|
||||
but if you do, your teacher may send you to magic kindergarten.
|
||||
|
|
|
@ -53,6 +53,7 @@ SRCS = \
|
|||
force_user_invis.c \
|
||||
hurt.c \
|
||||
ip_cloaking.c \
|
||||
ip_cloaking-5.c \
|
||||
sno_farconnect.c \
|
||||
sno_globalkline.c \
|
||||
sno_globaloper.c \
|
||||
|
|
|
@ -31,8 +31,7 @@ h_can_create_channel_authenticated(hook_data_client_approval *data)
|
|||
{
|
||||
struct Client *source_p = data->client;
|
||||
|
||||
if (!IsOper(source_p))
|
||||
{
|
||||
if (!IsOper(source_p)) {
|
||||
sendto_one_notice(source_p, ":*** Channel creation is restricted to network staff only.");
|
||||
data->approved = ERR_NEEDREGGEDNICK;
|
||||
}
|
||||
|
|
|
@ -159,12 +159,9 @@ DECLARE_MODULE_AV1(
|
|||
static int
|
||||
munreg_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(parc < 2)
|
||||
{
|
||||
if(parc < 2) {
|
||||
sendto_one_notice(source_p, ":You are unregistered and sent no parameters");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sendto_one_notice(source_p, ":You are unregistered and sent parameter: %s", parv[1]);
|
||||
}
|
||||
|
||||
|
@ -181,12 +178,9 @@ munreg_test(struct Client *client_p, struct Client *source_p, int parc, const ch
|
|||
static int
|
||||
mclient_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(parc < 2)
|
||||
{
|
||||
if(parc < 2) {
|
||||
sendto_one_notice(source_p, ":You are a normal user, and sent no parameters");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sendto_one_notice(source_p, ":You are a normal user, and send parameters: %s", parv[1]);
|
||||
}
|
||||
|
||||
|
@ -203,12 +197,9 @@ mclient_test(struct Client *client_p, struct Client *source_p, int parc, const c
|
|||
static int
|
||||
mrclient_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(parc < 2)
|
||||
{
|
||||
if(parc < 2) {
|
||||
sendto_one_notice(source_p, ":You are a remote client, and sent no parameters");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sendto_one_notice(source_p, ":You are a remote client, and sent parameters: %s", parv[1]);
|
||||
}
|
||||
return 0;
|
||||
|
@ -221,12 +212,9 @@ mrclient_test(struct Client *client_p, struct Client *source_p, int parc, const
|
|||
static int
|
||||
mserver_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(parc < 2)
|
||||
{
|
||||
if(parc < 2) {
|
||||
sendto_one_notice(source_p, ":You are a server, and sent no parameters");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sendto_one_notice(source_p, ":You are a server, and sent parameters: %s", parv[1]);
|
||||
}
|
||||
return 0;
|
||||
|
@ -239,12 +227,9 @@ mserver_test(struct Client *client_p, struct Client *source_p, int parc, const c
|
|||
static int
|
||||
moper_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(parc < 2)
|
||||
{
|
||||
if(parc < 2) {
|
||||
sendto_one_notice(source_p, ":You are an operator, and sent no parameters");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sendto_one_notice(source_p, ":You are an operator, and sent parameters: %s", parv[1]);
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -41,14 +41,13 @@ static int eb_extended(const char *data, struct Client *client_p,
|
|||
if (data == NULL)
|
||||
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);
|
||||
|
||||
ret = match(data, buf) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
|
||||
|
||||
if (ret == EXTBAN_NOMATCH && IsDynSpoof(client_p))
|
||||
{
|
||||
rb_snprintf(buf, BUFSIZE, "%s!%s@%s#%s",
|
||||
if (ret == EXTBAN_NOMATCH && IsDynSpoof(client_p)) {
|
||||
snprintf(buf, BUFSIZE, "%s!%s@%s#%s",
|
||||
client_p->name, client_p->username, client_p->orighost, client_p->info);
|
||||
|
||||
ret = match(data, buf) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
|
||||
|
|
|
@ -156,8 +156,7 @@ modfini(void)
|
|||
rb_event_delete(hurt_expire_ev);
|
||||
rb_event_delete(hurt_check_ev);
|
||||
|
||||
RB_DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_state.hurt_clients.head)
|
||||
{
|
||||
RB_DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_state.hurt_clients.head) {
|
||||
rb_dlinkDestroy(ptr, &hurt_state.hurt_clients);
|
||||
}
|
||||
}
|
||||
|
@ -207,23 +206,18 @@ mo_hurt(struct Client *client_p, struct Client *source_p,
|
|||
}
|
||||
|
||||
/* Is this a client? */
|
||||
if (strchr(ip, '.') == NULL && strchr(ip, ':') == NULL)
|
||||
{
|
||||
if (strchr(ip, '.') == NULL && strchr(ip, ':') == NULL) {
|
||||
target_p = find_named_person(ip);
|
||||
if (target_p == NULL)
|
||||
{
|
||||
if (target_p == NULL) {
|
||||
sendto_one_numeric(source_p, ERR_NOSUCHNICK,
|
||||
form_str(ERR_NOSUCHNICK), ip);
|
||||
return 0;
|
||||
}
|
||||
ip = target_p->orighost;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
if (!strncmp(ip, "*@", 2))
|
||||
ip += 2;
|
||||
if (strchr(ip, '!') || strchr(ip, '@'))
|
||||
{
|
||||
if (strchr(ip, '!') || strchr(ip, '@')) {
|
||||
sendto_one_notice(source_p, ":Invalid HURT mask [%s]",
|
||||
ip);
|
||||
return 0;
|
||||
|
@ -302,18 +296,15 @@ mo_heal(struct Client *client_p, struct Client *source_p,
|
|||
{
|
||||
struct Client *target_p;
|
||||
|
||||
if (!IsOperUnkline(source_p))
|
||||
{
|
||||
if (!IsOperUnkline(source_p)) {
|
||||
sendto_one(source_p, form_str(ERR_NOPRIVS),
|
||||
me.name, source_p->name, "unkline");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (nick_is_valid(parv[1]))
|
||||
{
|
||||
if (nick_is_valid(parv[1])) {
|
||||
target_p = find_named_person(parv[1]);
|
||||
if (target_p == NULL)
|
||||
{
|
||||
if (target_p == NULL) {
|
||||
sendto_one_numeric(source_p, ERR_NOSUCHNICK,
|
||||
form_str(ERR_NOSUCHNICK), parv[1]);
|
||||
return 0;
|
||||
|
@ -325,11 +316,8 @@ mo_heal(struct Client *client_p, struct Client *source_p,
|
|||
get_id(source_p, target_p),
|
||||
target_p->servptr->name,
|
||||
get_id(target_p, target_p));
|
||||
}
|
||||
else if (strchr(parv[1], '.'))
|
||||
{
|
||||
if (hurt_find_exact(parv[1]) == NULL)
|
||||
{
|
||||
} else if (strchr(parv[1], '.')) {
|
||||
if (hurt_find_exact(parv[1]) == NULL) {
|
||||
sendto_one_notice(source_p, ":Mask [%s] is not HURT", parv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
@ -338,9 +326,7 @@ mo_heal(struct Client *client_p, struct Client *source_p,
|
|||
get_oper_name(source_p), parv[1]);
|
||||
sendto_server(NULL, NULL, NOCAPS, NOCAPS, ":%s ENCAP * HEAL %s",
|
||||
source_p->name, parv[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sendto_one(source_p, ":[%s] is not a valid IP address/nick", parv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
@ -361,22 +347,18 @@ me_heal(struct Client *client_p, struct Client *source_p,
|
|||
if (parc < 2)
|
||||
return 0;
|
||||
|
||||
if (nick_is_valid(parv[1]))
|
||||
{
|
||||
if (nick_is_valid(parv[1])) {
|
||||
target_p = find_person(parv[1]);
|
||||
if (target_p != NULL && MyConnect(target_p))
|
||||
heal_nick(source_p, target_p);
|
||||
}
|
||||
else if (strchr(parv[1], '.')) /* host or mask to remove ban for */
|
||||
{
|
||||
} else if (strchr(parv[1], '.')) { /* host or mask to remove ban for */
|
||||
if (hurt_find_exact(parv[1]) == NULL)
|
||||
return 0;
|
||||
|
||||
hurt_remove(parv[1]);
|
||||
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s removed HURT on %s",
|
||||
get_oper_name(source_p), parv[1]);
|
||||
}
|
||||
else
|
||||
} else
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
|
@ -395,13 +377,11 @@ hurt_check_event(void *arg)
|
|||
|
||||
RB_DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_state.hurt_clients.head) {
|
||||
client_p = ptr->data;
|
||||
if (!EmptyString(client_p->user->suser))
|
||||
{
|
||||
if (!EmptyString(client_p->user->suser)) {
|
||||
rb_dlinkDestroy(ptr, &hurt_state.hurt_clients);
|
||||
sendto_one_notice(client_p, ":HURT restriction removed for this session");
|
||||
client_p->localClient->target_last = rb_current_time(); /* don't ask --nenolod */
|
||||
}
|
||||
else if (client_p->localClient->receiveM > hurt_state.cutoff)
|
||||
} else if (client_p->localClient->receiveM > hurt_state.cutoff)
|
||||
exit_client(NULL, client_p, &me, hurt_state.exit_reason);
|
||||
}
|
||||
}
|
||||
|
@ -414,12 +394,10 @@ hurt_expire_event(void *unused)
|
|||
rb_dlink_node *ptr, *next_ptr;
|
||||
hurt_t *hurt;
|
||||
|
||||
RB_DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_confs.head)
|
||||
{
|
||||
RB_DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_confs.head) {
|
||||
hurt = (hurt_t *) ptr->data;
|
||||
|
||||
if (hurt->expire <= rb_current_time())
|
||||
{
|
||||
if (hurt->expire <= rb_current_time()) {
|
||||
rb_dlinkFindDestroy(hurt, &hurt_confs);
|
||||
hurt_destroy(hurt);
|
||||
}
|
||||
|
@ -450,8 +428,7 @@ new_local_user_hook(struct Client *source_p)
|
|||
IsExemptKline(source_p))
|
||||
return;
|
||||
|
||||
if (hurt_find(source_p->sockhost) || hurt_find(source_p->orighost))
|
||||
{
|
||||
if (hurt_find(source_p->sockhost) || hurt_find(source_p->orighost)) {
|
||||
source_p->localClient->target_last = rb_current_time() + 600; /* don't ask --nenolod */
|
||||
SetTGChange(source_p);
|
||||
rb_dlinkAddAlloc(source_p, &hurt_state.hurt_clients);
|
||||
|
@ -476,11 +453,9 @@ doing_stats_hook(hook_data_int *hdata)
|
|||
return;
|
||||
if((ConfigFileEntry.stats_k_oper_only == 2) && !IsOper(source_p))
|
||||
return;
|
||||
if ((ConfigFileEntry.stats_k_oper_only == 1) && !IsOper(source_p))
|
||||
{
|
||||
if ((ConfigFileEntry.stats_k_oper_only == 1) && !IsOper(source_p)) {
|
||||
hurt = hurt_find(source_p->sockhost);
|
||||
if (hurt != NULL)
|
||||
{
|
||||
if (hurt != NULL) {
|
||||
sendto_one_numeric(source_p, RPL_STATSKLINE,
|
||||
form_str(RPL_STATSKLINE), 's',
|
||||
"*", hurt->ip, hurt->reason, "", "");
|
||||
|
@ -488,8 +463,7 @@ doing_stats_hook(hook_data_int *hdata)
|
|||
}
|
||||
|
||||
hurt = hurt_find(source_p->orighost);
|
||||
if (hurt != NULL)
|
||||
{
|
||||
if (hurt != NULL) {
|
||||
sendto_one_numeric(source_p, RPL_STATSKLINE,
|
||||
form_str(RPL_STATSKLINE), 's',
|
||||
"*", hurt->ip, hurt->reason, "", "");
|
||||
|
@ -498,8 +472,7 @@ doing_stats_hook(hook_data_int *hdata)
|
|||
return;
|
||||
}
|
||||
|
||||
RB_DLINK_FOREACH(ptr, hurt_confs.head)
|
||||
{
|
||||
RB_DLINK_FOREACH(ptr, hurt_confs.head) {
|
||||
hurt = (hurt_t *) ptr->data;
|
||||
sendto_one_numeric(source_p, RPL_STATSKLINE,
|
||||
form_str(RPL_STATSKLINE), 's',
|
||||
|
@ -577,8 +550,7 @@ hurt_find_exact(const char *ip)
|
|||
rb_dlink_node *ptr;
|
||||
hurt_t *hurt;
|
||||
|
||||
RB_DLINK_FOREACH(ptr, hurt_confs.head)
|
||||
{
|
||||
RB_DLINK_FOREACH(ptr, hurt_confs.head) {
|
||||
hurt = (hurt_t *) ptr->data;
|
||||
|
||||
if (!strcasecmp(ip, hurt->ip))
|
||||
|
@ -594,8 +566,7 @@ hurt_find(const char *ip)
|
|||
rb_dlink_node *ptr;
|
||||
hurt_t *hurt;
|
||||
|
||||
RB_DLINK_FOREACH(ptr, hurt_confs.head)
|
||||
{
|
||||
RB_DLINK_FOREACH(ptr, hurt_confs.head) {
|
||||
hurt = (hurt_t *) ptr->data;
|
||||
|
||||
if (match(hurt->ip, ip))
|
||||
|
@ -618,17 +589,14 @@ hurt_remove(const char *ip)
|
|||
static int
|
||||
heal_nick(struct Client *source_p, struct Client *target_p)
|
||||
{
|
||||
if (rb_dlinkFindDestroy(target_p, &hurt_state.hurt_clients))
|
||||
{
|
||||
if (rb_dlinkFindDestroy(target_p, &hurt_state.hurt_clients)) {
|
||||
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s used HEAL on %s",
|
||||
get_oper_name(source_p), get_client_name(target_p, HIDE_IP));
|
||||
sendto_one_notice(target_p, ":HURT restriction temporarily removed by operator");
|
||||
sendto_one_notice(source_p, ":HURT restriction on %s temporarily removed", target_p->name);
|
||||
target_p->localClient->target_last = rb_current_time(); /* don't ask --nenolod */
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sendto_one_notice(source_p, ":%s was not hurt", target_p->name);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -84,8 +84,7 @@ do_host_cloak_ip(const char *inbuf, char *outbuf)
|
|||
|
||||
rb_strlcpy(outbuf, inbuf, HOSTLEN + 1);
|
||||
|
||||
if (strchr(outbuf, ':'))
|
||||
{
|
||||
if (strchr(outbuf, ':')) {
|
||||
ipv6 = 1;
|
||||
|
||||
/* Damn you IPv6...
|
||||
|
@ -99,14 +98,11 @@ do_host_cloak_ip(const char *inbuf, char *outbuf)
|
|||
for (tptr = outbuf; *tptr != '\0'; tptr++)
|
||||
if (*tptr == ':')
|
||||
totalcount++;
|
||||
}
|
||||
else if (!strchr(outbuf, '.'))
|
||||
} else if (!strchr(outbuf, '.'))
|
||||
return;
|
||||
|
||||
for (tptr = outbuf; *tptr != '\0'; tptr++)
|
||||
{
|
||||
if (*tptr == ':' || *tptr == '.')
|
||||
{
|
||||
for (tptr = outbuf; *tptr != '\0'; tptr++) {
|
||||
if (*tptr == ':' || *tptr == '.') {
|
||||
sepcount++;
|
||||
continue;
|
||||
}
|
||||
|
@ -136,8 +132,7 @@ do_host_cloak_host(const char *inbuf, char *outbuf)
|
|||
*
|
||||
* numbers are not changed at this time, only letters.
|
||||
*/
|
||||
for (tptr = outbuf; *tptr != '\0'; tptr++)
|
||||
{
|
||||
for (tptr = outbuf; *tptr != '\0'; tptr++) {
|
||||
if (*tptr == '.')
|
||||
break;
|
||||
|
||||
|
@ -151,8 +146,7 @@ do_host_cloak_host(const char *inbuf, char *outbuf)
|
|||
}
|
||||
|
||||
/* pass 2: scramble each number in the address */
|
||||
for (tptr = outbuf; *tptr != '\0'; tptr++)
|
||||
{
|
||||
for (tptr = outbuf; *tptr != '\0'; tptr++) {
|
||||
if (isdigit(*tptr))
|
||||
*tptr = '0' + (*tptr + accum) % 10;
|
||||
|
||||
|
@ -173,26 +167,19 @@ check_umode_change(void *vdata)
|
|||
if (!((data->oldumodes ^ source_p->umodes) & user_modes['x']))
|
||||
return;
|
||||
|
||||
if (source_p->umodes & user_modes['x'])
|
||||
{
|
||||
if (IsIPSpoof(source_p) || source_p->localClient->mangledhost == NULL || (IsDynSpoof(source_p) && strcmp(source_p->host, source_p->localClient->mangledhost)))
|
||||
{
|
||||
if (source_p->umodes & user_modes['x']) {
|
||||
if (IsIPSpoof(source_p) || source_p->localClient->mangledhost == NULL || (IsDynSpoof(source_p) && strcmp(source_p->host, source_p->localClient->mangledhost))) {
|
||||
source_p->umodes &= ~user_modes['x'];
|
||||
return;
|
||||
}
|
||||
if (strcmp(source_p->host, source_p->localClient->mangledhost))
|
||||
{
|
||||
if (strcmp(source_p->host, source_p->localClient->mangledhost)) {
|
||||
distribute_hostchange(source_p, source_p->localClient->mangledhost);
|
||||
}
|
||||
else /* not really nice, but we need to send this numeric here */
|
||||
} else /* not really nice, but we need to send this numeric here */
|
||||
sendto_one_numeric(source_p, RPL_HOSTHIDDEN, "%s :is now your hidden host",
|
||||
source_p->host);
|
||||
}
|
||||
else if (!(source_p->umodes & user_modes['x']))
|
||||
{
|
||||
} else if (!(source_p->umodes & user_modes['x'])) {
|
||||
if (source_p->localClient->mangledhost != NULL &&
|
||||
!strcmp(source_p->host, source_p->localClient->mangledhost))
|
||||
{
|
||||
!strcmp(source_p->host, source_p->localClient->mangledhost)) {
|
||||
distribute_hostchange(source_p, source_p->orighost);
|
||||
}
|
||||
}
|
||||
|
@ -203,8 +190,7 @@ check_new_user(void *vdata)
|
|||
{
|
||||
struct Client *source_p = (void *)vdata;
|
||||
|
||||
if (IsIPSpoof(source_p))
|
||||
{
|
||||
if (IsIPSpoof(source_p)) {
|
||||
source_p->umodes &= ~user_modes['x'];
|
||||
return;
|
||||
}
|
||||
|
@ -215,8 +201,7 @@ check_new_user(void *vdata)
|
|||
do_host_cloak_host(source_p->orighost, source_p->localClient->mangledhost);
|
||||
if (IsDynSpoof(source_p))
|
||||
source_p->umodes &= ~user_modes['x'];
|
||||
if (source_p->umodes & user_modes['x'])
|
||||
{
|
||||
if (source_p->umodes & user_modes['x']) {
|
||||
rb_strlcpy(source_p->host, source_p->localClient->mangledhost, sizeof(source_p->host));
|
||||
if (irccmp(source_p->host, source_p->orighost))
|
||||
SetDynSpoof(source_p);
|
||||
|
|
|
@ -14,7 +14,8 @@ static int mclient_42(struct Client *client_p, struct Client *source_p, int parc
|
|||
|
||||
struct Message hgtg_msgtab = {
|
||||
"42", 0, 0, 0, MFLG_SLOW,
|
||||
{ mg_ignore, {mclient_42, 0}, mg_ignore, mg_ignore, mg_ignore, {mclient_42, 0}
|
||||
{
|
||||
mg_ignore, {mclient_42, 0}, mg_ignore, mg_ignore, mg_ignore, {mclient_42, 0}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -58,8 +58,7 @@ DECLARE_MODULE_AV1(adminwall, NULL, NULL, adminwall_clist, NULL, NULL, "$Revisio
|
|||
static int
|
||||
mo_adminwall(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(!IsAdmin(source_p))
|
||||
{
|
||||
if(!IsAdmin(source_p)) {
|
||||
sendto_one(source_p, form_str(ERR_NOPRIVS),
|
||||
me.name, source_p->name, "adminwall");
|
||||
return 0;
|
||||
|
|
|
@ -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))
|
||||
flood_endgrace(source_p);
|
||||
|
||||
while(name)
|
||||
{
|
||||
if((chptr = find_channel(name)) == NULL)
|
||||
{
|
||||
while(name) {
|
||||
if((chptr = find_channel(name)) == NULL) {
|
||||
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL, form_str(ERR_NOSUCHCHANNEL), name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
msptr = find_channel_membership(chptr, source_p);
|
||||
if(msptr == NULL)
|
||||
{
|
||||
if(msptr == NULL) {
|
||||
sendto_one_numeric(source_p, ERR_NOTONCHANNEL, form_str(ERR_NOTONCHANNEL), name);
|
||||
return 0;
|
||||
}
|
||||
|
@ -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) ||
|
||||
((can_send(chptr, source_p, msptr) > 0 &&
|
||||
(source_p->localClient->firsttime +
|
||||
ConfigFileEntry.anti_spam_exit_message_time) < rb_current_time()))))
|
||||
{
|
||||
ConfigFileEntry.anti_spam_exit_message_time) < rb_current_time())))) {
|
||||
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
|
||||
":%s PART %s :Cycling", use_id(source_p), chptr->chname);
|
||||
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s PART %s :Cycling",
|
||||
source_p->name, source_p->username,
|
||||
source_p->host, chptr->chname);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
|
||||
":%s PART %s", use_id(source_p), chptr->chname);
|
||||
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s PART %s",
|
||||
|
|
|
@ -62,39 +62,31 @@ m_findforwards(struct Client *client_p, struct Client *source_p, int parc, const
|
|||
*p = '\0';
|
||||
|
||||
/* Allow ircops to search for forwards to nonexistent channels */
|
||||
if(!IsOper(source_p))
|
||||
{
|
||||
if((chptr = find_channel(parv[1])) == NULL || (msptr = find_channel_membership(chptr, source_p)) == NULL)
|
||||
{
|
||||
if(!IsOper(source_p)) {
|
||||
if((chptr = find_channel(parv[1])) == NULL || (msptr = find_channel_membership(chptr, source_p)) == NULL) {
|
||||
sendto_one_numeric(source_p, ERR_NOTONCHANNEL,
|
||||
form_str(ERR_NOTONCHANNEL), parv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!is_any_op(msptr))
|
||||
{
|
||||
if(!is_any_op(msptr)) {
|
||||
sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
|
||||
me.name, source_p->name, parv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
|
||||
{
|
||||
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time()) {
|
||||
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
||||
me.name, source_p->name, "FINDFORWARDS");
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
} else
|
||||
last_used = rb_current_time();
|
||||
}
|
||||
|
||||
RB_DLINK_FOREACH(ptr, global_channel_list.head)
|
||||
{
|
||||
RB_DLINK_FOREACH(ptr, global_channel_list.head) {
|
||||
chptr = ptr->data;
|
||||
if(chptr->mode.forward && !irccmp(chptr->mode.forward, parv[1]))
|
||||
{
|
||||
if(p + strlen(chptr->chname) >= end - 13)
|
||||
{
|
||||
if(chptr->mode.forward && !irccmp(chptr->mode.forward, parv[1])) {
|
||||
if(p + strlen(chptr->chname) >= end - 13) {
|
||||
strcpy(p, "<truncated> ");
|
||||
p += 12;
|
||||
break;
|
||||
|
|
|
@ -74,8 +74,7 @@ mo_forcejoin(struct Client *client_p, struct Client *source_p, int parc, const c
|
|||
char sjmode;
|
||||
char *newch;
|
||||
|
||||
if(!IsOperAdmin(source_p))
|
||||
{
|
||||
if(!IsOperAdmin(source_p)) {
|
||||
sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "admin");
|
||||
return 0;
|
||||
}
|
||||
|
@ -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
|
||||
* to source_p and bail - scuzzy
|
||||
*/
|
||||
if((target_p = find_client(parv[1])) == NULL)
|
||||
{
|
||||
if((target_p = find_client(parv[1])) == NULL) {
|
||||
sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, source_p->name, parv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
/* select our modes from parv[2] if they exist... (chanop) */
|
||||
if(*parv[2] == '@')
|
||||
{
|
||||
if(*parv[2] == '@') {
|
||||
type = CHFL_CHANOP;
|
||||
mode = 'o';
|
||||
sjmode = '@';
|
||||
}
|
||||
else if(*parv[2] == '+')
|
||||
{
|
||||
} else if(*parv[2] == '+') {
|
||||
type = CHFL_VOICE;
|
||||
mode = 'v';
|
||||
sjmode = '+';
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
type = CHFL_PEON;
|
||||
mode = sjmode = '\0';
|
||||
}
|
||||
|
@ -127,10 +120,8 @@ mo_forcejoin(struct Client *client_p, struct Client *source_p, int parc, const c
|
|||
if(mode != '\0')
|
||||
parv[2]++;
|
||||
|
||||
if((chptr = find_channel(parv[2])) != NULL)
|
||||
{
|
||||
if(IsMember(target_p, chptr))
|
||||
{
|
||||
if((chptr = find_channel(parv[2])) != NULL) {
|
||||
if(IsMember(target_p, chptr)) {
|
||||
/* debugging is fun... */
|
||||
sendto_one_notice(source_p, ":*** Notice -- %s is already in %s",
|
||||
target_p->name, chptr->chname);
|
||||
|
@ -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",
|
||||
me.name, chptr->chname, mode, target_p->name);
|
||||
|
||||
if(chptr->topic != NULL)
|
||||
{
|
||||
if(chptr->topic != NULL) {
|
||||
sendto_one(target_p, form_str(RPL_TOPIC), me.name,
|
||||
target_p->name, chptr->chname, chptr->topic);
|
||||
sendto_one(target_p, form_str(RPL_TOPICWHOTIME),
|
||||
|
@ -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);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
newch = LOCAL_COPY(parv[2]);
|
||||
if(!check_channel_name(newch))
|
||||
{
|
||||
if(!check_channel_name(newch)) {
|
||||
sendto_one(source_p, form_str(ERR_BADCHANNAME), me.name,
|
||||
source_p->name, (unsigned char *) newch);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* channel name must begin with & or # */
|
||||
if(!IsChannelName(newch))
|
||||
{
|
||||
if(!IsChannelName(newch)) {
|
||||
sendto_one(source_p, form_str(ERR_BADCHANNAME), me.name,
|
||||
source_p->name, (unsigned char *) newch);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* newch can't be longer than CHANNELLEN */
|
||||
if(strlen(newch) > CHANNELLEN)
|
||||
{
|
||||
if(strlen(newch) > CHANNELLEN) {
|
||||
sendto_one_notice(source_p, ":Channel name is too long");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -65,11 +65,11 @@ DECLARE_MODULE_AV1(identify, NULL, NULL, identify_clist, NULL, NULL, "$Revision:
|
|||
|
||||
char *reconstruct_parv(int parc, const char *parv[])
|
||||
{
|
||||
static char tmpbuf[BUFSIZE]; int i;
|
||||
static char tmpbuf[BUFSIZE];
|
||||
int i;
|
||||
|
||||
rb_strlcpy(tmpbuf, parv[0], BUFSIZE);
|
||||
for (i = 1; i < parc; i++)
|
||||
{
|
||||
for (i = 1; i < parc; i++) {
|
||||
rb_strlcat(tmpbuf, " ", BUFSIZE);
|
||||
rb_strlcat(tmpbuf, parv[i], BUFSIZE);
|
||||
}
|
||||
|
@ -81,19 +81,15 @@ static int m_identify(struct Client *client_p, struct Client *source_p, int parc
|
|||
const char *nick;
|
||||
struct Client *target_p;
|
||||
|
||||
if (parc < 2 || EmptyString(parv[1]))
|
||||
{
|
||||
if (parc < 2 || EmptyString(parv[1])) {
|
||||
sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), me.name, source_p->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
nick = parv[1][0] == '#' ? SVS_chanserv_NICK : SVS_nickserv_NICK;
|
||||
if ((target_p = find_named_person(nick)) && IsService(target_p))
|
||||
{
|
||||
if ((target_p = find_named_person(nick)) && IsService(target_p)) {
|
||||
sendto_one(target_p, ":%s PRIVMSG %s :IDENTIFY %s", get_id(source_p, target_p), get_id(target_p, target_p), reconstruct_parv(parc - 1, &parv[1]));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sendto_one_numeric(source_p, ERR_SERVICESDOWN, form_str(ERR_SERVICESDOWN), nick);
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -26,7 +26,7 @@ static char *generate_random_salt(char *, int);
|
|||
static char *generate_poor_salt(char *, int);
|
||||
|
||||
static char saltChars[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
/* 0 .. 63, ascii - 64 */
|
||||
/* 0 .. 63, ascii - 64 */
|
||||
|
||||
struct Message mkpasswd_msgtab = {
|
||||
"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 hashdefault[] = "SHA512";
|
||||
|
||||
if(EmptyString(parv[1]))
|
||||
{
|
||||
if(EmptyString(parv[1])) {
|
||||
sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "MKPASSWD");
|
||||
return 0;
|
||||
}
|
||||
|
@ -61,13 +60,11 @@ m_mkpasswd(struct Client *client_p, struct Client *source_p, int parc, const cha
|
|||
else
|
||||
hashtype = parv[2];
|
||||
|
||||
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
|
||||
{
|
||||
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time()) {
|
||||
/* safe enough to give this on a local connect only */
|
||||
sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name, "MKPASSWD");
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
} else
|
||||
last_used = rb_current_time();
|
||||
|
||||
if(!irccmp(hashtype, "SHA256"))
|
||||
|
@ -76,8 +73,7 @@ m_mkpasswd(struct Client *client_p, struct Client *source_p, int parc, const cha
|
|||
salt = make_sha512_salt(16);
|
||||
else if(!irccmp(hashtype, "MD5"))
|
||||
salt = make_md5_salt(8);
|
||||
else
|
||||
{
|
||||
else {
|
||||
sendto_one_notice(source_p,
|
||||
":MKPASSWD syntax error: MKPASSWD pass [SHA256|SHA512|MD5]");
|
||||
return 0;
|
||||
|
@ -98,8 +94,7 @@ mo_mkpasswd(struct Client *client_p, struct Client *source_p, int parc, const ch
|
|||
const char *hashtype;
|
||||
const char hashdefault[] = "SHA512";
|
||||
|
||||
if(EmptyString(parv[1]))
|
||||
{
|
||||
if(EmptyString(parv[1])) {
|
||||
sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "MKPASSWD");
|
||||
return 0;
|
||||
}
|
||||
|
@ -115,8 +110,7 @@ mo_mkpasswd(struct Client *client_p, struct Client *source_p, int parc, const ch
|
|||
salt = make_sha512_salt(16);
|
||||
else if(!irccmp(hashtype, "MD5"))
|
||||
salt = make_md5_salt(8);
|
||||
else
|
||||
{
|
||||
else {
|
||||
sendto_one_notice(source_p,
|
||||
":MKPASSWD syntax error: MKPASSWD pass [SHA256|SHA512|MD5]");
|
||||
return 0;
|
||||
|
@ -130,8 +124,7 @@ char *
|
|||
make_md5_salt(int length)
|
||||
{
|
||||
static char salt[21];
|
||||
if(length > 16)
|
||||
{
|
||||
if(length > 16) {
|
||||
printf("MD5 salt length too long\n");
|
||||
exit(0);
|
||||
}
|
||||
|
@ -148,8 +141,7 @@ char *
|
|||
make_sha256_salt(int length)
|
||||
{
|
||||
static char salt[21];
|
||||
if(length > 16)
|
||||
{
|
||||
if(length > 16) {
|
||||
printf("SHA256 salt length too long\n");
|
||||
exit(0);
|
||||
}
|
||||
|
@ -166,8 +158,7 @@ char *
|
|||
make_sha512_salt(int length)
|
||||
{
|
||||
static char salt[21];
|
||||
if(length > 16)
|
||||
{
|
||||
if(length > 16) {
|
||||
printf("SHA512 salt length too long\n");
|
||||
exit(0);
|
||||
}
|
||||
|
@ -185,8 +176,7 @@ generate_poor_salt(char *salt, int length)
|
|||
{
|
||||
int i;
|
||||
srand(time(NULL));
|
||||
for(i = 0; i < length; i++)
|
||||
{
|
||||
for(i = 0; i < length; i++) {
|
||||
salt[i] = saltChars[rand() % 64];
|
||||
}
|
||||
return (salt);
|
||||
|
@ -197,19 +187,16 @@ generate_random_salt(char *salt, int length)
|
|||
{
|
||||
char *buf;
|
||||
int fd, i;
|
||||
if((fd = open("/dev/random", O_RDONLY)) < 0)
|
||||
{
|
||||
if((fd = open("/dev/random", O_RDONLY)) < 0) {
|
||||
return (generate_poor_salt(salt, length));
|
||||
}
|
||||
buf = calloc(1, length);
|
||||
if(read(fd, buf, length) != length)
|
||||
{
|
||||
if(read(fd, buf, length) != length) {
|
||||
free(buf);
|
||||
return (generate_poor_salt(salt, length));
|
||||
}
|
||||
|
||||
for(i = 0; i < length; i++)
|
||||
{
|
||||
for(i = 0; i < length; i++) {
|
||||
salt[i] = saltChars[abs(buf[i]) % 64];
|
||||
}
|
||||
free(buf);
|
||||
|
|
|
@ -25,27 +25,23 @@ mo_oaccept(struct Client *client_p, struct Client *source_p, int parc, const cha
|
|||
struct Client *target_p;
|
||||
char text[10];
|
||||
|
||||
if(!(target_p = find_client(parv[1])))
|
||||
{
|
||||
if(!(target_p = find_client(parv[1]))) {
|
||||
sendto_one(source_p, form_str(ERR_NOSUCHNICK), parv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* If we don't check for this, and some idiot tries to OACCEPT a server... */
|
||||
if(!IsPerson(target_p))
|
||||
{
|
||||
if(!IsPerson(target_p)) {
|
||||
sendto_one_notice(source_p, ":That is a server, not a user. What are you doing?");
|
||||
return 0;
|
||||
}
|
||||
|
||||
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
|
||||
* who you've already OACCEPTed. */
|
||||
DICTIONARY_FOREACH(md, &iter, target_p->user->metadata)
|
||||
{
|
||||
if(!strcmp(md->value, "OACCEPT") && !strcmp(md->name, text))
|
||||
{
|
||||
DICTIONARY_FOREACH(md, &iter, target_p->user->metadata) {
|
||||
if(!strcmp(md->value, "OACCEPT") && !strcmp(md->name, text)) {
|
||||
sendto_one_notice(source_p, ":You're already on %s's OACCEPT list", target_p->name);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -58,27 +58,23 @@ mo_ojoin(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
int move_me = 0;
|
||||
|
||||
/* admins only */
|
||||
if(!IsOperAdmin(source_p))
|
||||
{
|
||||
if(!IsOperAdmin(source_p)) {
|
||||
sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "admin");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(*parv[1] == '@' || *parv[1] == '%' || *parv[1] == '+' || *parv[1] == '!' || *parv[1] == '~')
|
||||
{
|
||||
if(*parv[1] == '@' || *parv[1] == '%' || *parv[1] == '+' || *parv[1] == '!' || *parv[1] == '~') {
|
||||
parv[1]++;
|
||||
move_me = 1;
|
||||
}
|
||||
|
||||
if((chptr = find_channel(parv[1])) == NULL)
|
||||
{
|
||||
if((chptr = find_channel(parv[1])) == NULL) {
|
||||
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
|
||||
form_str(ERR_NOSUCHCHANNEL), parv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(IsMember(source_p, chptr))
|
||||
{
|
||||
if(IsMember(source_p, chptr)) {
|
||||
sendto_one_notice(source_p, ":Please part %s before using OJOIN", parv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
@ -97,8 +93,7 @@ mo_ojoin(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
me.name, parv[1],
|
||||
source_p->name, source_p->username, source_p->host);
|
||||
|
||||
if(*parv[1] == '~' && ConfigChannel.use_owner)
|
||||
{
|
||||
if(*parv[1] == '~' && ConfigChannel.use_owner) {
|
||||
add_user_to_channel(chptr, source_p, CHFL_OWNER);
|
||||
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
|
||||
":%s SJOIN %ld %s + :~%s",
|
||||
|
@ -106,11 +101,9 @@ mo_ojoin(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s JOIN %s",
|
||||
source_p->name,
|
||||
source_p->username, source_p->host, chptr->chname);
|
||||
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +q %s",
|
||||
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +y %s",
|
||||
me.name, chptr->chname, source_p->name);
|
||||
}
|
||||
else if(*parv[1] == '!' && ConfigChannel.use_admin)
|
||||
{
|
||||
} else if(*parv[1] == '!' && ConfigChannel.use_admin) {
|
||||
add_user_to_channel(chptr, source_p, CHFL_ADMIN);
|
||||
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
|
||||
":%s SJOIN %ld %s + :!%s",
|
||||
|
@ -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",
|
||||
me.name, chptr->chname, source_p->name);
|
||||
|
||||
}
|
||||
else if(*parv[1] == '@')
|
||||
{
|
||||
} else if(*parv[1] == '@') {
|
||||
add_user_to_channel(chptr, source_p, CHFL_CHANOP);
|
||||
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
|
||||
":%s SJOIN %ld %s + :@%s",
|
||||
|
@ -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",
|
||||
me.name, chptr->chname, source_p->name);
|
||||
|
||||
}
|
||||
else if(*parv[1] == '%' && ConfigChannel.use_halfop)
|
||||
{
|
||||
} else if(*parv[1] == '%' && ConfigChannel.use_halfop) {
|
||||
add_user_to_channel(chptr, source_p, CHFL_HALFOP);
|
||||
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
|
||||
":%s SJOIN %ld %s + :%s%s",
|
||||
|
@ -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);
|
||||
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +h %s",
|
||||
me.name, chptr->chname, source_p->name);
|
||||
}
|
||||
else if(*parv[1] == '+')
|
||||
{
|
||||
} else if(*parv[1] == '+') {
|
||||
add_user_to_channel(chptr, source_p, CHFL_VOICE);
|
||||
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
|
||||
":%s SJOIN %ld %s + :+%s",
|
||||
|
@ -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);
|
||||
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +v %s",
|
||||
me.name, chptr->chname, source_p->name);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
add_user_to_channel(chptr, source_p, CHFL_PEON);
|
||||
sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
|
||||
":%s JOIN %ld %s +",
|
||||
|
@ -171,8 +156,7 @@ mo_ojoin(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
}
|
||||
|
||||
/* send the topic... */
|
||||
if(chptr->topic != NULL)
|
||||
{
|
||||
if(chptr->topic != NULL) {
|
||||
sendto_one(source_p, form_str(RPL_TOPIC), me.name,
|
||||
source_p->name, chptr->chname, chptr->topic);
|
||||
sendto_one(source_p, form_str(RPL_TOPICWHOTIME), me.name,
|
||||
|
|
|
@ -70,8 +70,7 @@ mo_okick(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
char text[10];
|
||||
static char buf[BUFSIZE];
|
||||
|
||||
if(*parv[2] == '\0')
|
||||
{
|
||||
if(*parv[2] == '\0') {
|
||||
sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "KICK");
|
||||
return 0;
|
||||
}
|
||||
|
@ -90,8 +89,7 @@ mo_okick(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
name = LOCAL_COPY(parv[1]);
|
||||
|
||||
chptr = find_channel(name);
|
||||
if(!chptr)
|
||||
{
|
||||
if(!chptr) {
|
||||
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL, form_str(ERR_NOSUCHCHANNEL), name);
|
||||
return 0;
|
||||
}
|
||||
|
@ -100,19 +98,16 @@ mo_okick(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
if((p = strchr(parv[2], ',')))
|
||||
*p = '\0';
|
||||
user = LOCAL_COPY(parv[2]); // strtoken(&p2, parv[2], ",");
|
||||
if(!(who = find_chasing(source_p, user, &chasing)))
|
||||
{
|
||||
if(!(who = find_chasing(source_p, user, &chasing))) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if((target_p = find_client(user)) == NULL)
|
||||
{
|
||||
if((target_p = find_client(user)) == NULL) {
|
||||
sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, source_p->name, user);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if((msptr = find_channel_membership(chptr, target_p)) == NULL)
|
||||
{
|
||||
if((msptr = find_channel_membership(chptr, target_p)) == NULL) {
|
||||
sendto_one(source_p, form_str(ERR_USERNOTINCHANNEL),
|
||||
me.name, source_p->name, parv[1], parv[2]);
|
||||
return 0;
|
||||
|
@ -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);
|
||||
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 */
|
||||
if(MyClient(who) && chptr->mode.mode & MODE_NOREJOIN)
|
||||
|
|
|
@ -66,8 +66,7 @@ static void list_named_channel(struct Client *source_p, const char *name);
|
|||
static int
|
||||
mo_olist(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(!IsOperSpy(source_p))
|
||||
{
|
||||
if(!IsOperSpy(source_p)) {
|
||||
sendto_one(source_p, form_str(ERR_NOPRIVS),
|
||||
me.name, source_p->name, "oper_spy");
|
||||
sendto_one(source_p, form_str(RPL_LISTEND),
|
||||
|
@ -101,8 +100,7 @@ list_all_channels(struct Client *source_p)
|
|||
report_operspy(source_p, "LIST", NULL);
|
||||
sendto_one(source_p, form_str(RPL_LISTSTART), me.name, source_p->name);
|
||||
|
||||
RB_DLINK_FOREACH(ptr, global_channel_list.head)
|
||||
{
|
||||
RB_DLINK_FOREACH(ptr, global_channel_list.head) {
|
||||
chptr = ptr->data;
|
||||
|
||||
sendto_one(source_p, ":%s 322 %s %s %lu :[%s] %s",
|
||||
|
|
|
@ -66,15 +66,13 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
int wasonchannel;
|
||||
|
||||
/* admins only */
|
||||
if(!IsOperAdmin(source_p))
|
||||
{
|
||||
if(!IsOperAdmin(source_p)) {
|
||||
sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "admin");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Now, try to find the channel in question */
|
||||
if(!IsChanPrefix(parv[1][0]) || !check_channel_name(parv[1]))
|
||||
{
|
||||
if(!IsChanPrefix(parv[1][0]) || !check_channel_name(parv[1])) {
|
||||
sendto_one_numeric(source_p, ERR_BADCHANNAME,
|
||||
form_str(ERR_BADCHANNAME), parv[1]);
|
||||
return 0;
|
||||
|
@ -82,8 +80,7 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
|
||||
chptr = find_channel(parv[1]);
|
||||
|
||||
if(chptr == NULL)
|
||||
{
|
||||
if(chptr == NULL) {
|
||||
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
|
||||
form_str(ERR_NOSUCHCHANNEL), parv[1]);
|
||||
return 0;
|
||||
|
@ -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);
|
||||
wasonchannel = msptr != NULL;
|
||||
|
||||
if (is_any_op(msptr))
|
||||
{
|
||||
if (is_any_op(msptr)) {
|
||||
sendto_one_notice(source_p, ":Use a normal MODE you idiot");
|
||||
return 0;
|
||||
}
|
||||
|
||||
params[0] = '\0';
|
||||
for (i = 2; i < parc; i++)
|
||||
{
|
||||
for (i = 2; i < parc; i++) {
|
||||
if (i != 2)
|
||||
rb_strlcat(params, " ", sizeof params);
|
||||
rb_strlcat(params, parv[i], sizeof params);
|
||||
|
@ -123,28 +118,23 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
set_channel_mode(client_p, source_p->servptr, chptr, msptr,
|
||||
parc - 2, parv + 2);
|
||||
#else
|
||||
if (parc == 4 && !strcmp(parv[2], "+q") && !irccmp(parv[3], source_p->name))
|
||||
{
|
||||
if (parc == 4 && !strcmp(parv[2], "+y") && !irccmp(parv[3], source_p->name)) {
|
||||
/* Ownering themselves */
|
||||
if (!wasonchannel)
|
||||
{
|
||||
if (!wasonchannel) {
|
||||
sendto_one_numeric(source_p, ERR_USERNOTINCHANNEL,
|
||||
form_str(ERR_USERNOTINCHANNEL), parv[3], chptr->chname);
|
||||
return 0;
|
||||
}
|
||||
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +q %s",
|
||||
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +y %s",
|
||||
me.name, parv[1], source_p->name);
|
||||
sendto_server(NULL, chptr, CAP_TS6, NOCAPS,
|
||||
":%s TMODE %ld %s +q %s",
|
||||
":%s TMODE %ld %s +y %s",
|
||||
me.id, (long) chptr->channelts, parv[1],
|
||||
source_p->id);
|
||||
msptr->flags |= CHFL_OWNER;
|
||||
}
|
||||
else if (parc == 4 && !strcmp(parv[2], "+a") && !irccmp(parv[3], source_p->name))
|
||||
{
|
||||
} else if (parc == 4 && !strcmp(parv[2], "+a") && !irccmp(parv[3], source_p->name)) {
|
||||
/* Admining themselves */
|
||||
if (!wasonchannel)
|
||||
{
|
||||
if (!wasonchannel) {
|
||||
sendto_one_numeric(source_p, ERR_USERNOTINCHANNEL,
|
||||
form_str(ERR_USERNOTINCHANNEL), parv[3], chptr->chname);
|
||||
return 0;
|
||||
|
@ -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],
|
||||
source_p->id);
|
||||
msptr->flags |= CHFL_ADMIN;
|
||||
}
|
||||
else if (parc == 4 && !strcmp(parv[2], "+o") && !irccmp(parv[3], source_p->name))
|
||||
{
|
||||
} else if (parc == 4 && !strcmp(parv[2], "+o") && !irccmp(parv[3], source_p->name)) {
|
||||
/* Opping themselves */
|
||||
if (!wasonchannel)
|
||||
{
|
||||
if (!wasonchannel) {
|
||||
sendto_one_numeric(source_p, ERR_USERNOTINCHANNEL,
|
||||
form_str(ERR_USERNOTINCHANNEL), parv[3], chptr->chname);
|
||||
return 0;
|
||||
|
@ -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],
|
||||
source_p->id);
|
||||
msptr->flags |= CHFL_CHANOP;
|
||||
}
|
||||
else if (parc == 4 && !strcmp(parv[2], "+h") && !irccmp(parv[3], source_p->name))
|
||||
{
|
||||
} else if (parc == 4 && !strcmp(parv[2], "+h") && !irccmp(parv[3], source_p->name)) {
|
||||
/* Halfopping themselves */
|
||||
if (!wasonchannel)
|
||||
{
|
||||
if (!wasonchannel) {
|
||||
sendto_one_numeric(source_p, ERR_USERNOTINCHANNEL,
|
||||
form_str(ERR_USERNOTINCHANNEL), parv[3], chptr->chname);
|
||||
return 0;
|
||||
|
@ -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],
|
||||
source_p->id);
|
||||
msptr->flags |= CHFL_HALFOP;
|
||||
}
|
||||
else if (ConfigChannel.use_owner)
|
||||
{
|
||||
} else if (ConfigChannel.use_owner) {
|
||||
/* I hope this is correct.
|
||||
* -- Kabaka */
|
||||
|
||||
/* Hack it so set_channel_mode() will accept */
|
||||
if (wasonchannel)
|
||||
msptr->flags |= CHFL_OWNER;
|
||||
else
|
||||
{
|
||||
else {
|
||||
add_user_to_channel(chptr, source_p, CHFL_CHANOP);
|
||||
msptr = find_channel_membership(chptr, source_p);
|
||||
}
|
||||
|
@ -210,14 +191,11 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
msptr->flags &= ~CHFL_OWNER;
|
||||
else
|
||||
remove_user_from_channel(msptr);
|
||||
}
|
||||
else if (ConfigChannel.use_admin)
|
||||
{
|
||||
} else if (ConfigChannel.use_admin) {
|
||||
/* Hack it so set_channel_mode() will accept */
|
||||
if (wasonchannel)
|
||||
msptr->flags |= CHFL_ADMIN;
|
||||
else
|
||||
{
|
||||
else {
|
||||
add_user_to_channel(chptr, source_p, CHFL_CHANOP);
|
||||
msptr = find_channel_membership(chptr, source_p);
|
||||
}
|
||||
|
@ -230,15 +208,12 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
msptr->flags &= ~CHFL_ADMIN;
|
||||
else
|
||||
remove_user_from_channel(msptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
/* CHFL_ADMIN is only useful if admin is enabled
|
||||
* so hack it with op if it is not. */
|
||||
if (wasonchannel)
|
||||
msptr->flags |= CHFL_CHANOP;
|
||||
else
|
||||
{
|
||||
else {
|
||||
add_user_to_channel(chptr, source_p, CHFL_CHANOP);
|
||||
msptr = find_channel_membership(chptr, source_p);
|
||||
}
|
||||
|
|
|
@ -58,25 +58,21 @@ mo_opme(struct Client *client_p, struct Client *source_p, int parc, const char *
|
|||
rb_dlink_node *ptr;
|
||||
|
||||
/* admins only */
|
||||
if(!IsOperAdmin(source_p))
|
||||
{
|
||||
if(!IsOperAdmin(source_p)) {
|
||||
sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "admin");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if((chptr = find_channel(parv[1])) == NULL)
|
||||
{
|
||||
if((chptr = find_channel(parv[1])) == NULL) {
|
||||
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
|
||||
form_str(ERR_NOSUCHCHANNEL), parv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
RB_DLINK_FOREACH(ptr, chptr->members.head)
|
||||
{
|
||||
RB_DLINK_FOREACH(ptr, chptr->members.head) {
|
||||
msptr = ptr->data;
|
||||
|
||||
if(is_chanop(msptr) || is_admin(msptr) || is_owner(msptr))
|
||||
{
|
||||
if(is_chanop(msptr) || is_admin(msptr) || is_owner(msptr)) {
|
||||
sendto_one_notice(source_p, ":%s Channel is not opless", parv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
@ -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));
|
||||
|
||||
/* dont send stuff for local channels remotely. */
|
||||
if(*chptr->chname != '&')
|
||||
{
|
||||
if(*chptr->chname != '&') {
|
||||
sendto_server(NULL, NULL, NOCAPS, NOCAPS,
|
||||
":%s WALLOPS :OPME called for [%s] by %s!%s@%s",
|
||||
me.name, parv[1], source_p->name, source_p->username, source_p->host);
|
||||
|
|
|
@ -139,27 +139,23 @@ m_displaymsg(struct Client *source_p, const char *channel, int underline, int ac
|
|||
char *nick3 = rb_strdup(nick);
|
||||
char text2[BUFSIZE];
|
||||
|
||||
if((chptr = find_channel(channel)) == NULL)
|
||||
{
|
||||
if((chptr = find_channel(channel)) == NULL) {
|
||||
sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), channel);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!(msptr = find_channel_membership(chptr, source_p)))
|
||||
{
|
||||
if(!(msptr = find_channel_membership(chptr, source_p))) {
|
||||
sendto_one_numeric(source_p, ERR_NOTONCHANNEL,
|
||||
form_str(ERR_NOTONCHANNEL), chptr->chname);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!(chptr->mode.mode & chmode_flags['N']))
|
||||
{
|
||||
if(!(chptr->mode.mode & chmode_flags['N'])) {
|
||||
sendto_one_numeric(source_p, 573, "%s :Roleplay commands are not enabled on this channel.", chptr->chname);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!can_send(chptr, source_p, msptr))
|
||||
{
|
||||
if(!can_send(chptr, source_p, msptr)) {
|
||||
sendto_one_numeric(source_p, 573, "%s :Cannot send to channel.", chptr->chname);
|
||||
return 0;
|
||||
}
|
||||
|
@ -169,30 +165,28 @@ m_displaymsg(struct Client *source_p, const char *channel, int underline, int ac
|
|||
return 0;
|
||||
|
||||
/* enforce target change on roleplay commands */
|
||||
if(!is_chanop_voiced(msptr) && !IsOper(source_p) && !add_channel_target(source_p, chptr))
|
||||
{
|
||||
if(!is_chanop_voiced(msptr) && !IsOper(source_p) && !add_channel_target(source_p, chptr)) {
|
||||
sendto_one(source_p, form_str(ERR_TARGCHANGE),
|
||||
me.name, source_p->name, chptr->chname);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(underline)
|
||||
rb_snprintf(nick2, sizeof(nick2), "\x1F%s\x1F", strip_unprintable(nick3));
|
||||
snprintf(nick2, sizeof(nick2), "\x1F%s\x1F", strip_unprintable(nick3));
|
||||
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
|
||||
* this prevents nastiness like fake factions, etc. */
|
||||
if(EmptyString(nick3))
|
||||
{
|
||||
if(EmptyString(nick3)) {
|
||||
sendto_one_numeric(source_p, 573, "%s :No visible non-stripped characters in nick.", chptr->chname);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(action)
|
||||
rb_snprintf(text2, sizeof(text2), "\1ACTION %s\1", text);
|
||||
snprintf(text2, sizeof(text2), "\1ACTION %s\1", text);
|
||||
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 (%s)", nick2, source_p->name, channel, text2, source_p->name);
|
||||
sendto_match_servs(source_p, "*", CAP_ENCAP, NOCAPS, "ENCAP * ROLEPLAY %s %s :%s",
|
||||
|
|
|
@ -69,8 +69,7 @@ static const char *expand_xline(const char *mask)
|
|||
return NULL;
|
||||
p = mask;
|
||||
q = buf;
|
||||
while (*p != '\0')
|
||||
{
|
||||
while (*p != '\0') {
|
||||
if (*p == ' ')
|
||||
*q++ = '\\', *q++ = 's';
|
||||
else
|
||||
|
@ -89,20 +88,17 @@ static int mo_sendbans(struct Client *client_p, struct Client *source_p, int par
|
|||
const char *target, *mask2;
|
||||
struct Client *server_p;
|
||||
|
||||
if (!IsOperRemoteBan(source_p))
|
||||
{
|
||||
if (!IsOperRemoteBan(source_p)) {
|
||||
sendto_one(source_p, form_str(ERR_NOPRIVS),
|
||||
me.name, source_p->name, "remoteban");
|
||||
return 0;
|
||||
}
|
||||
if (!IsOperXline(source_p))
|
||||
{
|
||||
if (!IsOperXline(source_p)) {
|
||||
sendto_one(source_p, form_str(ERR_NOPRIVS),
|
||||
me.name, source_p->name, "xline");
|
||||
return 0;
|
||||
}
|
||||
if (!IsOperResv(source_p))
|
||||
{
|
||||
if (!IsOperResv(source_p)) {
|
||||
sendto_one(source_p, form_str(ERR_NOPRIVS),
|
||||
me.name, source_p->name, "resv");
|
||||
return 0;
|
||||
|
@ -110,16 +106,14 @@ static int mo_sendbans(struct Client *client_p, struct Client *source_p, int par
|
|||
|
||||
target = parv[1];
|
||||
count = 0;
|
||||
RB_DLINK_FOREACH(ptr, global_serv_list.head)
|
||||
{
|
||||
RB_DLINK_FOREACH(ptr, global_serv_list.head) {
|
||||
server_p = ptr->data;
|
||||
if (IsMe(server_p))
|
||||
continue;
|
||||
if (match(target, server_p->name))
|
||||
count++;
|
||||
}
|
||||
if (count == 0)
|
||||
{
|
||||
if (count == 0) {
|
||||
sendto_one_numeric(source_p, ERR_NOSUCHSERVER,
|
||||
form_str(ERR_NOSUCHSERVER), target);
|
||||
return 0;
|
||||
|
@ -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,
|
||||
target);
|
||||
|
||||
RB_DLINK_FOREACH(ptr, resv_conf_list.head)
|
||||
{
|
||||
RB_DLINK_FOREACH(ptr, resv_conf_list.head) {
|
||||
aconf = ptr->data;
|
||||
if (aconf->hold)
|
||||
continue;
|
||||
|
@ -141,8 +134,7 @@ static int mo_sendbans(struct Client *client_p, struct Client *source_p, int par
|
|||
target, aconf->host, aconf->passwd);
|
||||
}
|
||||
|
||||
HASH_WALK(i, R_MAX, ptr, resvTable)
|
||||
{
|
||||
HASH_WALK(i, R_MAX, ptr, resvTable) {
|
||||
aconf = ptr->data;
|
||||
if (aconf->hold)
|
||||
continue;
|
||||
|
@ -153,14 +145,12 @@ static int mo_sendbans(struct Client *client_p, struct Client *source_p, int par
|
|||
}
|
||||
HASH_WALK_END
|
||||
|
||||
RB_DLINK_FOREACH(ptr, xline_conf_list.head)
|
||||
{
|
||||
RB_DLINK_FOREACH(ptr, xline_conf_list.head) {
|
||||
aconf = ptr->data;
|
||||
if (aconf->hold)
|
||||
continue;
|
||||
mask2 = expand_xline(aconf->host);
|
||||
if (mask2 == NULL)
|
||||
{
|
||||
if (mask2 == NULL) {
|
||||
sendto_one_notice(source_p, ":Skipping xline [%s]",
|
||||
aconf->host);
|
||||
continue;
|
||||
|
|
|
@ -77,8 +77,7 @@ mr_webirc(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
struct ConfItem *aconf;
|
||||
const char *encr;
|
||||
|
||||
if (!strchr(parv[4], '.') && !strchr(parv[4], ':'))
|
||||
{
|
||||
if (!strchr(parv[4], '.') && !strchr(parv[4], ':')) {
|
||||
sendto_one(source_p, "NOTICE * :Invalid IP");
|
||||
return 0;
|
||||
}
|
||||
|
@ -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);
|
||||
if (aconf == NULL || !(aconf->status & CONF_CLIENT))
|
||||
return 0;
|
||||
if (!IsConfDoSpoofIp(aconf) || irccmp(aconf->info.name, "webirc."))
|
||||
{
|
||||
if (!IsConfDoSpoofIp(aconf) || irccmp(aconf->info.name, "webirc.")) {
|
||||
/* XXX */
|
||||
sendto_one(source_p, "NOTICE * :Not a CGI:IRC auth block");
|
||||
return 0;
|
||||
}
|
||||
if (EmptyString(aconf->passwd))
|
||||
{
|
||||
if (EmptyString(aconf->passwd)) {
|
||||
sendto_one(source_p, "NOTICE * :CGI:IRC auth blocks must have a password");
|
||||
return 0;
|
||||
}
|
||||
|
@ -109,8 +106,7 @@ mr_webirc(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
else
|
||||
encr = parv[1];
|
||||
|
||||
if (strcmp(encr, aconf->passwd))
|
||||
{
|
||||
if (strcmp(encr, aconf->passwd)) {
|
||||
sendto_one(source_p, "NOTICE * :CGI:IRC password incorrect");
|
||||
return 0;
|
||||
}
|
||||
|
@ -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 */
|
||||
if((aconf = find_dline((struct sockaddr *)&source_p->localClient->ip,
|
||||
source_p->localClient->ip.ss_family)))
|
||||
{
|
||||
if(!(aconf->status & CONF_EXEMPTDLINE))
|
||||
{
|
||||
source_p->localClient->ip.ss_family))) {
|
||||
if(!(aconf->status & CONF_EXEMPTDLINE)) {
|
||||
exit_client(client_p, source_p, &me, "D-lined");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -26,8 +26,7 @@ h_nl_umode_changed(hook_data_umode_changed *hdata)
|
|||
{
|
||||
struct Client *source_p = hdata->client;
|
||||
|
||||
if (MyClient(source_p) && source_p->umodes & UMODE_LOCOPS)
|
||||
{
|
||||
if (MyClient(source_p) && source_p->umodes & UMODE_LOCOPS) {
|
||||
source_p->umodes &= ~UMODE_LOCOPS;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,8 +29,7 @@ h_noi_umode_changed(hook_data_umode_changed *hdata)
|
|||
struct Client *source_p = hdata->client;
|
||||
|
||||
if (MyClient(source_p) && IsOper(source_p) && !IsOperInvis(source_p) &&
|
||||
IsInvisible(source_p))
|
||||
{
|
||||
IsInvisible(source_p)) {
|
||||
ClearInvisible(source_p);
|
||||
/* If they tried /umode +i, complain; do not complain
|
||||
* if they opered up while invisible -- jilles */
|
||||
|
|
|
@ -34,27 +34,20 @@ h_gla_client_exit(hook_data_client_exit *hdata)
|
|||
|
||||
if (MyConnect(source_p) || !IsClient(source_p))
|
||||
return;
|
||||
if (!strcmp(hdata->comment, "Bad user info"))
|
||||
{
|
||||
if (!strcmp(hdata->comment, "Bad user info")) {
|
||||
sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
|
||||
"XLINE active for %s[%s@%s]",
|
||||
source_p->name, source_p->username, source_p->host);
|
||||
}
|
||||
else if (ConfigFileEntry.kline_reason != NULL &&
|
||||
!strcmp(hdata->comment, ConfigFileEntry.kline_reason))
|
||||
{
|
||||
} else if (ConfigFileEntry.kline_reason != NULL &&
|
||||
!strcmp(hdata->comment, ConfigFileEntry.kline_reason)) {
|
||||
sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
|
||||
"K/DLINE active for %s[%s@%s]",
|
||||
source_p->name, source_p->username, source_p->host);
|
||||
}
|
||||
else if (!strncmp(hdata->comment, "Temporary K-line ", 17))
|
||||
{
|
||||
} else if (!strncmp(hdata->comment, "Temporary K-line ", 17)) {
|
||||
sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
|
||||
"K/DLINE active for %s[%s@%s]",
|
||||
source_p->name, source_p->username, source_p->host);
|
||||
}
|
||||
else if (!strncmp(hdata->comment, "Temporary D-line ", 17))
|
||||
{
|
||||
} else if (!strncmp(hdata->comment, "Temporary D-line ", 17)) {
|
||||
sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
|
||||
"K/DLINE active for %s[%s@%s]",
|
||||
source_p->name, source_p->username, source_p->host);
|
||||
|
|
|
@ -52,8 +52,7 @@ show_whois(hook_data_client *data)
|
|||
IsOper(target_p) &&
|
||||
#endif
|
||||
(source_p != target_p) &&
|
||||
(target_p->snomask & snomask_modes['W']))
|
||||
{
|
||||
(target_p->snomask & snomask_modes['W'])) {
|
||||
sendto_one_notice(target_p,
|
||||
":*** Notice -- %s (%s@%s) is doing a whois on you [%s]",
|
||||
source_p->name,
|
||||
|
|
|
@ -41,8 +41,7 @@ show_stats(hook_data_int *data)
|
|||
{
|
||||
char statchar = (char) data->arg2;
|
||||
|
||||
if(statchar == 'L' || statchar == 'l')
|
||||
{
|
||||
if(statchar == 'L' || statchar == 'l') {
|
||||
const char *name = data->arg1;
|
||||
|
||||
if(!EmptyString(name))
|
||||
|
@ -58,9 +57,7 @@ show_stats(hook_data_int *data)
|
|||
statchar, data->client->name,
|
||||
data->client->username,
|
||||
data->client->host, data->client->servptr->name);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
sendto_realops_snomask(SNO_SPY, L_ALL,
|
||||
"STATS %c requested by %s (%s@%s) [%s]",
|
||||
statchar, data->client->name, data->client->username,
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
setuser ircd /home/ircd/run/bin/ircd -foreground
|
|
@ -17,7 +17,8 @@
|
|||
#include "version.h"
|
||||
|
||||
IRCDVar myIrcd[] = {
|
||||
{"Elemental-IRCd+ihw 6.5", /* ircd name */
|
||||
{
|
||||
"Elemental-IRCd 6.5", /* ircd name */
|
||||
"+oiS", /* nickserv mode */
|
||||
"+oiS", /* chanserv mode */
|
||||
"+oiS", /* memoserv mode */
|
||||
|
@ -38,13 +39,13 @@ IRCDVar myIrcd[] = {
|
|||
"+oiS", /* Global alias mode */
|
||||
"+oiS", /* Used by BotServ Bots */
|
||||
2, /* Chan Max Symbols */
|
||||
"-cijlmnpstrgzF", /* Modes to Remove */
|
||||
"+o", /* Channel Umode used by Botserv bots */
|
||||
"-cijlmnpstrgzQF", /* Modes to Remove */
|
||||
"+ao", /* Channel Umode used by Botserv bots */
|
||||
1, /* SVSNICK */
|
||||
1, /* Vhost */
|
||||
1, /* Has Owner */
|
||||
"+q", /* Mode to set for an owner */
|
||||
"-q", /* Mode to unset for an owner */
|
||||
"+y", /* Mode to set for an owner */
|
||||
"-y", /* Mode to unset for an owner */
|
||||
"+a", /* Mode to set for chan admin */
|
||||
"-a", /* Mode to unset for chan admin */
|
||||
NULL, /* Mode On Reg */
|
||||
|
@ -145,7 +146,8 @@ IRCDCAPAB myIrcdcap[] = {
|
|||
0, /* TLKEXT */
|
||||
0, /* DODKEY */
|
||||
0, /* DOZIP */
|
||||
0, 0, 0}
|
||||
0, 0, 0
|
||||
}
|
||||
};
|
||||
|
||||
/*******************************************************************/
|
||||
|
@ -780,44 +782,82 @@ void moduleAddIRCDMsgs(void)
|
|||
TS6SID = sstrdup(Numeric);
|
||||
}
|
||||
|
||||
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
|
||||
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
|
||||
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
|
||||
m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m);
|
||||
m = createMessage("INVITE", anope_event_invite); addCoreMessage(IRCD,m);
|
||||
m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m);
|
||||
m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m);
|
||||
m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m);
|
||||
m = createMessage("MODE", anope_event_mode); addCoreMessage(IRCD,m);
|
||||
m = createMessage("TMODE", anope_event_tmode); addCoreMessage(IRCD,m);
|
||||
m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m);
|
||||
m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m);
|
||||
m = createMessage("BMASK", anope_event_bmask); addCoreMessage(IRCD,m);
|
||||
m = createMessage("UID", anope_event_nick); addCoreMessage(IRCD,m);
|
||||
m = createMessage("NOTICE", anope_event_notice); addCoreMessage(IRCD,m);
|
||||
m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m);
|
||||
m = createMessage("PASS", anope_event_pass); addCoreMessage(IRCD,m);
|
||||
m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m);
|
||||
m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m);
|
||||
m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m);
|
||||
m = createMessage("SERVER", anope_event_server); addCoreMessage(IRCD,m);
|
||||
m = createMessage("SQUIT", anope_event_squit); addCoreMessage(IRCD,m);
|
||||
m = createMessage("TOPIC", anope_event_topic); addCoreMessage(IRCD,m);
|
||||
m = createMessage("TB", anope_event_tburst); addCoreMessage(IRCD,m);
|
||||
m = createMessage("USER", anope_event_null); addCoreMessage(IRCD,m);
|
||||
m = createMessage("WALLOPS", anope_event_null); addCoreMessage(IRCD,m);
|
||||
m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m);
|
||||
m = createMessage("SVSMODE", anope_event_null); addCoreMessage(IRCD,m);
|
||||
m = createMessage("SVSNICK", anope_event_null); addCoreMessage(IRCD,m);
|
||||
m = createMessage("CAPAB", anope_event_capab); addCoreMessage(IRCD,m);
|
||||
m = createMessage("SJOIN", anope_event_sjoin); addCoreMessage(IRCD,m);
|
||||
m = createMessage("SVINFO", anope_event_svinfo); addCoreMessage(IRCD,m);
|
||||
m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m);
|
||||
m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m);
|
||||
m = createMessage("421", anope_event_null); addCoreMessage(IRCD,m);
|
||||
m = createMessage("ENCAP", anope_event_null); addCoreMessage(IRCD,m);
|
||||
m = createMessage("SID", anope_event_sid); addCoreMessage(IRCD,m);
|
||||
m = createMessage("EUID", anope_event_euid); addCoreMessage(IRCD,m);
|
||||
m = createMessage("401", anope_event_null);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("402", anope_event_null);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("436", anope_event_436);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("AWAY", anope_event_away);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("INVITE", anope_event_invite);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("JOIN", anope_event_join);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("KICK", anope_event_kick);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("KILL", anope_event_kill);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("MODE", anope_event_mode);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("TMODE", anope_event_tmode);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("MOTD", anope_event_motd);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("NICK", anope_event_nick);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("BMASK", anope_event_bmask);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("UID", anope_event_nick);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("NOTICE", anope_event_notice);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("PART", anope_event_part);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("PASS", anope_event_pass);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("PING", anope_event_ping);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("PRIVMSG", anope_event_privmsg);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("QUIT", anope_event_quit);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("SERVER", anope_event_server);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("SQUIT", anope_event_squit);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("TOPIC", anope_event_topic);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("TB", anope_event_tburst);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("USER", anope_event_null);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("WALLOPS", anope_event_null);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("WHOIS", anope_event_whois);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("SVSMODE", anope_event_null);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("SVSNICK", anope_event_null);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("CAPAB", anope_event_capab);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("SJOIN", anope_event_sjoin);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("SVINFO", anope_event_svinfo);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("ADMIN", anope_event_admin);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("ERROR", anope_event_error);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("421", anope_event_null);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("ENCAP", anope_event_null);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("SID", anope_event_sid);
|
||||
addCoreMessage(IRCD,m);
|
||||
m = createMessage("EUID", anope_event_euid);
|
||||
addCoreMessage(IRCD,m);
|
||||
}
|
||||
|
||||
/* *INDENT-ON* */
|
|
@ -12,8 +12,8 @@
|
|||
|
||||
#include "module.h"
|
||||
#include "modules/cs_mode.h"
|
||||
#include "modules/sasl.h"
|
||||
|
||||
static bool sasl = true;
|
||||
static Anope::string UplinkSID;
|
||||
|
||||
static ServiceReference<IRCDProto> ratbox("IRCDProto", "ratbox");
|
||||
|
@ -33,7 +33,7 @@ class ChannelModeLargeBan : public ChannelMode
|
|||
class ElementalProto : public IRCDProto
|
||||
{
|
||||
public:
|
||||
ElementalProto(Module *creator) : IRCDProto(creator, "Elemental-IRCd+ihw 6.5+")
|
||||
ElementalProto(Module *creator) : IRCDProto(creator, "Elemental-IRCd 6.5+")
|
||||
{
|
||||
DefaultPseudoclientModes = "+oiS";
|
||||
CanCertFP = true;
|
||||
|
@ -141,6 +141,18 @@ class ElementalProto : public IRCDProto
|
|||
{
|
||||
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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -175,84 +187,18 @@ struct IRCDMessageEncap : IRCDMessage
|
|||
* termination: 'A' for abort, 'F' for authentication failure, 'S' for
|
||||
* authentication success).
|
||||
*
|
||||
* Elemental only accepts messages from SASL agents; these must have umode +S
|
||||
* Charybdis only accepts messages from SASL agents; these must have umode +S
|
||||
*/
|
||||
if (params[1] == "SASL" && sasl && params.size() == 6)
|
||||
if (params[1] == "SASL" && SASL::sasl && params.size() >= 6)
|
||||
{
|
||||
class ElementalSASLIdentifyRequest : public IdentifyRequest
|
||||
{
|
||||
Anope::string uid;
|
||||
MessageSource msource;
|
||||
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] : "";
|
||||
|
||||
public:
|
||||
ElementalSASLIdentifyRequest(Module *m, MessageSource &source_, const Anope::string &id, const Anope::string &acc, const Anope::string &pass) : IdentifyRequest(m, acc, pass), uid(id), msource(source_) { }
|
||||
|
||||
void OnSuccess() anope_override
|
||||
{
|
||||
BotInfo *NickServ = Config->GetClient("NickServ");
|
||||
if (!NickServ)
|
||||
return;
|
||||
|
||||
/* SVSLOGIN
|
||||
* parameters: target, new nick, new username, new visible hostname, new login name
|
||||
* Sent after successful SASL authentication.
|
||||
* The target is a UID, typically an unregistered one.
|
||||
* Any of the "new" parameters can be '*' to leave the corresponding field
|
||||
* unchanged. The new login name can be '0' to log the user out.
|
||||
* If the UID is registered on the network, a SIGNON with the changes will be
|
||||
* broadcast, otherwise the changes will be stored, to be used when registration
|
||||
* completes.
|
||||
*/
|
||||
UplinkSocket::Message(Me) << "ENCAP " << msource.GetName() << " SVSLOGIN " << this->uid << " * * * " << this->GetAccount();
|
||||
UplinkSocket::Message(Me) << "ENCAP " << msource.GetName() << " SASL " << NickServ->GetUID() << " " << this->uid << " D S";
|
||||
}
|
||||
|
||||
void OnFail() anope_override
|
||||
{
|
||||
BotInfo *NickServ = Config->GetClient("NickServ");
|
||||
if (!NickServ)
|
||||
return;
|
||||
|
||||
UplinkSocket::Message(Me) << "ENCAP " << msource.GetName() << " SASL " << NickServ->GetUID() << " " << this->uid << " " << " D F";
|
||||
|
||||
Log(NickServ) << "A user failed to identify for account " << this->GetAccount() << " using SASL";
|
||||
}
|
||||
};
|
||||
if (params[4] == "S")
|
||||
{
|
||||
BotInfo *NickServ = Config->GetClient("NickServ");
|
||||
if (!NickServ)
|
||||
return;
|
||||
|
||||
if (params[5] == "PLAIN")
|
||||
UplinkSocket::Message(Me) << "ENCAP " << source.GetName() << " SASL " << NickServ->GetUID() << " " << params[2] << " C +";
|
||||
else
|
||||
UplinkSocket::Message(Me) << "ENCAP " << source.GetName() << " SASL " << NickServ->GetUID() << " " << params[2] << " D F";
|
||||
}
|
||||
else if (params[4] == "C")
|
||||
{
|
||||
Anope::string decoded;
|
||||
Anope::B64Decode(params[5], decoded);
|
||||
|
||||
size_t p = decoded.find('\0');
|
||||
if (p == Anope::string::npos)
|
||||
return;
|
||||
decoded = decoded.substr(p + 1);
|
||||
|
||||
p = decoded.find('\0');
|
||||
if (p == Anope::string::npos)
|
||||
return;
|
||||
|
||||
Anope::string acc = decoded.substr(0, p),
|
||||
pass = decoded.substr(p + 1);
|
||||
|
||||
if (acc.empty() || pass.empty())
|
||||
return;
|
||||
|
||||
IdentifyRequest *req = new ElementalSASLIdentifyRequest(this->owner, source, params[2], acc, pass);
|
||||
FOREACH_MOD(OnCheckAuthentication, (NULL, req));
|
||||
req->Dispatch();
|
||||
}
|
||||
SASL::sasl->ProcessMessage(m);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -280,7 +226,7 @@ struct IRCDMessageEUID : IRCDMessage
|
|||
if (params[9] != "*")
|
||||
na = NickAlias::Find(params[9]);
|
||||
|
||||
new User(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);
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -353,6 +299,11 @@ class ProtoElemental : public Module
|
|||
|
||||
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'));
|
||||
|
@ -373,13 +324,6 @@ class ProtoElemental : public Module
|
|||
ModeManager::AddChannelMode(new ChannelMode("PERM", 'P'));
|
||||
ModeManager::AddChannelMode(new ChannelMode("NOFORWARD", 'Q'));
|
||||
ModeManager::AddChannelMode(new ChannelMode("OPMODERATED", 'z'));
|
||||
|
||||
/* Add status modes */
|
||||
ModeManager::AddChannelMode(new ChannelModeStatus("VOICE", 'v', '+', 0));
|
||||
ModeManager::AddChannelMode(new ChannelModeStatus("HALFOP", 'h', '%', 1));
|
||||
ModeManager::AddChannelMode(new ChannelModeStatus("OP", 'o', '@', 2);
|
||||
ModeManager::AddChannelMode(new ChannelModeStatus("PROTECT", 'a', '&', 3));
|
||||
ModeManager::AddChannelMode(new ChannelModeStatus("OWNER", 'q', '~', 4));
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -425,7 +369,6 @@ class ProtoElemental : public Module
|
|||
void OnReload(Configuration::Conf *conf) anope_override
|
||||
{
|
||||
use_server_side_mlock = conf->GetModule(this)->Get<bool>("use_server_side_mlock");
|
||||
sasl = conf->GetModule(this)->Get<bool>("sasl");
|
||||
}
|
||||
|
||||
void OnChannelSync(Channel *c) anope_override
|
||||
|
|
|
@ -1,125 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2003-2004 E. Will et al.
|
||||
* Copyright (c) 2005-2008 Atheme Development Group
|
||||
* Copyright (c) 2008-2010 ShadowIRCd Development Group
|
||||
* Copyright (c) 2013 PonyChat Development Group
|
||||
* Rights to this code are documented in doc/LICENSE.
|
||||
*
|
||||
* This file contains protocol support for ponychat-ircd.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "atheme.h"
|
||||
#include "uplink.h"
|
||||
#include "pmodule.h"
|
||||
#include "protocol/shadowircd.h"
|
||||
|
||||
DECLARE_MODULE_V1("protocol/elemental-ircd", true, _modinit, NULL, PACKAGE_STRING, "PonyChat Development Group <http://www.ponychat.net>");
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
|
||||
ircd_t elemental_ircd = {
|
||||
"elemental-ircd+ihw", /* 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. */
|
||||
"+q", /* 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},
|
||||
{ '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 },
|
||||
{ 'u', CMODE_NOFORWARD },
|
||||
{ '\0', 0 }
|
||||
};
|
||||
|
||||
struct cmode_ elemental_status_mode_list[] = {
|
||||
{ 'q', 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
|
||||
*/
|
|
@ -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
|
||||
*/
|
|
@ -26,6 +26,8 @@ NO PARAMETERS:
|
|||
weakens +i control.
|
||||
+z - Op moderated. Messages blocked by +m, +b and +q are instead
|
||||
sent to ops.
|
||||
+u - Hidden ban/quiet list. Ban/quiet lists may only be seen
|
||||
by halfops or higher.
|
||||
* +L - Large ban list. Increase maximum number of +beIq entries.
|
||||
* +P - Permanent. Channel does not disappear when empty.
|
||||
+F - Free target. Anyone may set forwards to this (otherwise
|
||||
|
|
|
@ -24,6 +24,8 @@ NO PARAMETERS:
|
|||
change nick.
|
||||
+g - Free invite. Everyone may invite users. Significantly
|
||||
weakens +i control.
|
||||
+u - Hidden ban/quiet lists. Ban/quiet lists are hidden from all
|
||||
channel members that are not a halfop or higher.
|
||||
+z - Op moderated. Messages blocked by +m, +b and +q are instead
|
||||
sent to ops.
|
||||
* +L - Large ban list. Increase maximum number of +beIq entries.
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
|
||||
void init_bandb(void);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
BANDB_KLINE,
|
||||
BANDB_DLINE,
|
||||
BANDB_XLINE,
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
|
||||
#define HELP_MAX 100
|
||||
|
||||
#define CACHELINELEN 81
|
||||
/* Adjusted to allow wider MOTD */
|
||||
#define CACHELINELEN 513
|
||||
#define CACHEFILELEN 30
|
||||
/* two servernames, a gecos, three spaces, ":1", '\0' */
|
||||
#define LINKSLINELEN (HOSTLEN + HOSTLEN + REALLEN + 6)
|
||||
|
@ -13,15 +14,13 @@
|
|||
|
||||
struct Client;
|
||||
|
||||
struct cachefile
|
||||
{
|
||||
struct cachefile {
|
||||
char name[CACHEFILELEN];
|
||||
rb_dlink_list contents;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct cacheline
|
||||
{
|
||||
struct cacheline {
|
||||
char data[CACHELINELEN];
|
||||
rb_dlink_node linenode;
|
||||
};
|
||||
|
|
|
@ -35,8 +35,7 @@
|
|||
struct Client;
|
||||
|
||||
/* mode structure for channels */
|
||||
struct Mode
|
||||
{
|
||||
struct Mode {
|
||||
unsigned int mode;
|
||||
int limit;
|
||||
char key[KEYLEN];
|
||||
|
@ -46,8 +45,7 @@ struct Mode
|
|||
};
|
||||
|
||||
/* channel structure */
|
||||
struct Channel
|
||||
{
|
||||
struct Channel {
|
||||
rb_dlink_node node;
|
||||
struct Mode mode;
|
||||
char *mode_lock;
|
||||
|
@ -79,8 +77,7 @@ struct Channel
|
|||
char *chname;
|
||||
};
|
||||
|
||||
struct membership
|
||||
{
|
||||
struct membership {
|
||||
rb_dlink_node channode;
|
||||
rb_dlink_node locchannode;
|
||||
rb_dlink_node usernode;
|
||||
|
@ -93,22 +90,19 @@ struct membership
|
|||
};
|
||||
|
||||
#define BANLEN 195
|
||||
struct Ban
|
||||
{
|
||||
struct Ban {
|
||||
char *banstr;
|
||||
char *who;
|
||||
time_t when;
|
||||
rb_dlink_node node;
|
||||
};
|
||||
|
||||
struct mode_letter
|
||||
{
|
||||
struct mode_letter {
|
||||
int mode;
|
||||
char letter;
|
||||
};
|
||||
|
||||
struct ChModeChange
|
||||
{
|
||||
struct ChModeChange {
|
||||
char letter;
|
||||
const char *arg;
|
||||
const char *id;
|
||||
|
@ -120,8 +114,7 @@ struct ChModeChange
|
|||
struct Client *client;
|
||||
};
|
||||
|
||||
struct ChCapCombo
|
||||
{
|
||||
struct ChCapCombo {
|
||||
int count;
|
||||
int cap_yes;
|
||||
int cap_no;
|
||||
|
@ -131,8 +124,7 @@ typedef void (*ChannelModeFunc)(struct Client *source_p, struct Channel *chptr,
|
|||
int alevel, int parc, int *parn,
|
||||
const char **parv, int *errors, int dir, char c, long mode_type);
|
||||
|
||||
struct ChannelMode
|
||||
{
|
||||
struct ChannelMode {
|
||||
ChannelModeFunc set_func;
|
||||
long mode_type;
|
||||
};
|
||||
|
@ -310,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 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 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 void channel_metadata_clear(struct Channel *target);
|
||||
|
||||
|
|
|
@ -30,8 +30,7 @@ struct ConfItem;
|
|||
struct Client;
|
||||
struct _patricia_tree_t;
|
||||
|
||||
struct Class
|
||||
{
|
||||
struct Class {
|
||||
struct Class *next;
|
||||
char *class_name;
|
||||
int max_total;
|
||||
|
|
|
@ -76,8 +76,7 @@ struct scache_entry;
|
|||
/*
|
||||
* Client structures
|
||||
*/
|
||||
struct User
|
||||
{
|
||||
struct User {
|
||||
rb_dlink_list channel; /* chain of channel pointer blocks */
|
||||
rb_dlink_list invited; /* chain of invite pointer blocks */
|
||||
char *away; /* pointer to away message */
|
||||
|
@ -88,8 +87,7 @@ struct User
|
|||
char suser[NICKLEN+1];
|
||||
};
|
||||
|
||||
struct Server
|
||||
{
|
||||
struct Server {
|
||||
struct User *user; /* who activated this connection */
|
||||
char by[NICKLEN];
|
||||
rb_dlink_list servers;
|
||||
|
@ -99,8 +97,7 @@ struct Server
|
|||
struct scache_entry *nameinfo;
|
||||
};
|
||||
|
||||
struct ZipStats
|
||||
{
|
||||
struct ZipStats {
|
||||
unsigned long long in;
|
||||
unsigned long long in_wire;
|
||||
unsigned long long out;
|
||||
|
@ -109,8 +106,7 @@ struct ZipStats
|
|||
double out_ratio;
|
||||
};
|
||||
|
||||
struct Client
|
||||
{
|
||||
struct Client {
|
||||
rb_dlink_node node;
|
||||
rb_dlink_node lnode;
|
||||
struct User *user; /* ...defined, if this is a User */
|
||||
|
@ -170,8 +166,7 @@ struct Client
|
|||
char *certfp; /* client certificate fingerprint */
|
||||
};
|
||||
|
||||
struct LocalUser
|
||||
{
|
||||
struct LocalUser {
|
||||
rb_dlink_node tnode; /* This is the node for the local list type the client is on*/
|
||||
/*
|
||||
* The following fields are allocated only for local clients
|
||||
|
@ -286,8 +281,7 @@ struct LocalUser
|
|||
struct ev_entry *override_timeout_event;
|
||||
};
|
||||
|
||||
struct PreClient
|
||||
{
|
||||
struct PreClient {
|
||||
char spoofnick[NICKLEN + 1];
|
||||
char spoofuser[USERLEN + 1];
|
||||
char spoofhost[HOSTLEN + 1];
|
||||
|
@ -302,8 +296,7 @@ struct PreClient
|
|||
struct rb_sockaddr_storage lip; /* address of our side of the connection */
|
||||
};
|
||||
|
||||
struct ListClient
|
||||
{
|
||||
struct ListClient {
|
||||
unsigned int hash_indice;
|
||||
unsigned int users_min, users_max;
|
||||
time_t created_min, created_max, topic_min, topic_max;
|
||||
|
@ -616,8 +609,8 @@ extern char *generate_uid(void);
|
|||
void allocate_away(struct Client *);
|
||||
void free_away(struct Client *);
|
||||
|
||||
extern struct Metadata *user_metadata_add(struct Client *target, const char *name, const char *value, int propegate);
|
||||
extern void user_metadata_delete(struct Client *target, const char *name, 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 propagate);
|
||||
extern struct Metadata *user_metadata_find(struct Client *target, const char *name);
|
||||
extern void user_metadata_clear(struct Client *target);
|
||||
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
#ifndef INCLUDED_HOOK_H
|
||||
#define INCLUDED_HOOK_H
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
char *name;
|
||||
rb_dlink_list hooks;
|
||||
} hook;
|
||||
|
@ -36,64 +35,55 @@ void add_hook(const char *name, hookfn fn);
|
|||
void remove_hook(const char *name, hookfn fn);
|
||||
void call_hook(int id, void *arg);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
struct Client *client;
|
||||
const void *arg1;
|
||||
const void *arg2;
|
||||
} hook_data;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
struct Client *client;
|
||||
const void *arg1;
|
||||
int arg2;
|
||||
} hook_data_int;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
struct Client *client;
|
||||
struct Client *target;
|
||||
} hook_data_client;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
struct Client *client;
|
||||
struct Channel *chptr;
|
||||
int approved;
|
||||
} hook_data_channel;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
struct Client *client;
|
||||
struct Channel *chptr;
|
||||
char *key;
|
||||
} hook_data_channel_activity;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
struct Client *client;
|
||||
struct Channel *chptr;
|
||||
struct Client *target;
|
||||
int approved;
|
||||
} hook_data_channel_approval;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
struct Client *client;
|
||||
int approved;
|
||||
} hook_data_client_approval;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
struct Client *local_link; /* local client originating this, or NULL */
|
||||
struct Client *target; /* dying client */
|
||||
struct Client *from; /* causing client (could be &me or target) */
|
||||
const char *comment;
|
||||
} hook_data_client_exit;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
struct Client *client;
|
||||
unsigned int oldumodes;
|
||||
unsigned int oldsnomask;
|
||||
|
|
|
@ -26,8 +26,7 @@
|
|||
|
||||
#ifndef INCLUDE_hostmask_h
|
||||
#define INCLUDE_hostmask_h 1
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
HM_HOST,
|
||||
HM_IPV4
|
||||
#ifdef RB_IPV6
|
||||
|
@ -70,15 +69,12 @@ int match_ipv4(struct sockaddr *, struct sockaddr *, int);
|
|||
|
||||
extern struct AddressRec *atable[ATABLE_SIZE];
|
||||
|
||||
struct AddressRec
|
||||
{
|
||||
struct AddressRec {
|
||||
/* masktype: HM_HOST, HM_IPV4, HM_IPV6 -A1kmm */
|
||||
int masktype;
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
union {
|
||||
struct {
|
||||
/* Pointer into ConfItem... -A1kmm */
|
||||
struct rb_sockaddr_storage addr;
|
||||
int bits;
|
||||
|
|
|
@ -36,16 +36,13 @@ strip_colour(char *string)
|
|||
|
||||
/* c is source, c2 is target */
|
||||
for(; c && *c; c++)
|
||||
switch (*c)
|
||||
{
|
||||
switch (*c) {
|
||||
case 3:
|
||||
if(isdigit(c[1]))
|
||||
{
|
||||
if(isdigit(c[1])) {
|
||||
c++;
|
||||
if(isdigit(c[1]))
|
||||
c++;
|
||||
if(c[1] == ',' && isdigit(c[2]))
|
||||
{
|
||||
if(c[1] == ',' && isdigit(c[2])) {
|
||||
c += 2;
|
||||
if(isdigit(c[1]))
|
||||
c++;
|
||||
|
@ -87,16 +84,13 @@ strip_unprintable(char *string)
|
|||
|
||||
/* c is source, c2 is target */
|
||||
for(; c && *c; c++)
|
||||
switch (*c)
|
||||
{
|
||||
switch (*c) {
|
||||
case 3:
|
||||
if(isdigit(c[1]))
|
||||
{
|
||||
if(isdigit(c[1])) {
|
||||
c++;
|
||||
if(isdigit(c[1]))
|
||||
c++;
|
||||
if(c[1] == ',' && isdigit(c[2]))
|
||||
{
|
||||
if(c[1] == ',' && isdigit(c[2])) {
|
||||
c += 2;
|
||||
if(isdigit(c[1]))
|
||||
c++;
|
||||
|
|
|
@ -29,16 +29,14 @@ struct Dictionary; /* defined in src/dictionary.c */
|
|||
|
||||
typedef int (*DCF)(const char *a, const char *b);
|
||||
|
||||
struct DictionaryElement
|
||||
{
|
||||
struct DictionaryElement {
|
||||
struct DictionaryElement *left, *right, *prev, *next;
|
||||
void *data;
|
||||
const char *key;
|
||||
int position;
|
||||
};
|
||||
|
||||
struct DictionaryIter
|
||||
{
|
||||
struct DictionaryIter {
|
||||
struct DictionaryElement *cur, *next;
|
||||
};
|
||||
|
||||
|
|
|
@ -31,8 +31,7 @@
|
|||
struct Client;
|
||||
struct rb_dlink_list;
|
||||
|
||||
struct SetOptions
|
||||
{
|
||||
struct SetOptions {
|
||||
int maxclients; /* max clients allowed */
|
||||
int autoconn; /* autoconn enabled for all servers? */
|
||||
|
||||
|
@ -47,15 +46,13 @@ struct SetOptions
|
|||
char adminstring[REALLEN];
|
||||
};
|
||||
|
||||
struct Metadata
|
||||
{
|
||||
struct Metadata {
|
||||
const char *name;
|
||||
const char *value;
|
||||
time_t timevalue;
|
||||
};
|
||||
|
||||
struct Counter
|
||||
{
|
||||
struct Counter {
|
||||
int oper; /* Opers */
|
||||
int total; /* total clients */
|
||||
int invisi; /* invisible clients */
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
#endif
|
||||
|
||||
#define HOSTLEN 63 /* Length of hostname. Updated to */
|
||||
/* comply with RFC1123 */
|
||||
/* comply with RFC1123 */
|
||||
|
||||
#define USERLEN 10
|
||||
#define REALLEN 50
|
||||
|
|
|
@ -26,8 +26,7 @@
|
|||
#ifndef __GETOPT_H_INCLUDED__
|
||||
#define __GETOPT_H_INCLUDED__
|
||||
|
||||
struct lgetopt
|
||||
{
|
||||
struct lgetopt {
|
||||
const char *opt; /* name of the argument */
|
||||
void *argloc; /* where we store the argument to it (-option argument) */
|
||||
enum
|
||||
|
|
|
@ -37,8 +37,7 @@
|
|||
|
||||
#include <dlfcn.h>
|
||||
|
||||
struct ircd_symbol
|
||||
{
|
||||
struct ircd_symbol {
|
||||
char *sym; /* name of symbol to be bound to ptr */
|
||||
void *ptr; /* ptr to symbol in library */
|
||||
};
|
||||
|
|
|
@ -30,8 +30,7 @@
|
|||
|
||||
struct Client;
|
||||
|
||||
struct Listener
|
||||
{
|
||||
struct Listener {
|
||||
struct Listener *next; /* list node pointer */
|
||||
const char *name; /* listener name */
|
||||
rb_fde_t *F; /* file descriptor */
|
||||
|
|
|
@ -35,8 +35,7 @@
|
|||
|
||||
#include "ircd_defs.h"
|
||||
|
||||
typedef enum ilogfile
|
||||
{
|
||||
typedef enum ilogfile {
|
||||
L_MAIN,
|
||||
L_USER,
|
||||
L_FUSER,
|
||||
|
|
|
@ -28,8 +28,7 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
typedef struct Information
|
||||
{
|
||||
typedef struct Information {
|
||||
const char *name; /* name of item */
|
||||
const char *strvalue; /* value of item if it's a boolean */
|
||||
int intvalue; /* value of item if it's an integer */
|
||||
|
@ -64,11 +63,15 @@ Info MyInformation[] = {
|
|||
#endif /* UH PATH */
|
||||
|
||||
#ifdef SOMAXCONN
|
||||
{"RATBOX_SOMAXCONN", "", SOMAXCONN,
|
||||
"Maximum Queue Length of Pending Connections"},
|
||||
{
|
||||
"RATBOX_SOMAXCONN", "", SOMAXCONN,
|
||||
"Maximum Queue Length of Pending Connections"
|
||||
},
|
||||
#else
|
||||
{"RATBOX_SOMAXCONN", "", RATBOX_SOMAXCONN,
|
||||
"Maximum Queue Length of Pending Connections"},
|
||||
{
|
||||
"RATBOX_SOMAXCONN", "", RATBOX_SOMAXCONN,
|
||||
"Maximum Queue Length of Pending Connections"
|
||||
},
|
||||
#endif /* SOMAXCONN */
|
||||
|
||||
#ifdef RB_IPV6
|
||||
|
@ -77,11 +80,15 @@ Info MyInformation[] = {
|
|||
{"IPV6", "OFF", 0, "IPv6 Support"},
|
||||
#endif
|
||||
|
||||
{"JOIN_LEAVE_COUNT_EXPIRE_TIME", "", JOIN_LEAVE_COUNT_EXPIRE_TIME,
|
||||
"Anti SpamBot Parameter"},
|
||||
{
|
||||
"JOIN_LEAVE_COUNT_EXPIRE_TIME", "", JOIN_LEAVE_COUNT_EXPIRE_TIME,
|
||||
"Anti SpamBot Parameter"
|
||||
},
|
||||
|
||||
{"KILLCHASETIMELIMIT", "", KILLCHASETIMELIMIT,
|
||||
"Nick Change Tracker for KILL"},
|
||||
{
|
||||
"KILLCHASETIMELIMIT", "", KILLCHASETIMELIMIT,
|
||||
"Nick Change Tracker for KILL"
|
||||
},
|
||||
|
||||
#ifdef LPATH
|
||||
{"LPATH", LPATH, 0, "Path to Log File"},
|
||||
|
@ -91,11 +98,15 @@ Info MyInformation[] = {
|
|||
|
||||
{"MAX_BUFFER", "", MAX_BUFFER, "Maximum Buffer Connections Allowed"},
|
||||
|
||||
{"MAX_JOIN_LEAVE_COUNT", "", MAX_JOIN_LEAVE_COUNT,
|
||||
"Anti SpamBot Parameter"},
|
||||
{
|
||||
"MAX_JOIN_LEAVE_COUNT", "", MAX_JOIN_LEAVE_COUNT,
|
||||
"Anti SpamBot Parameter"
|
||||
},
|
||||
|
||||
{"MIN_JOIN_LEAVE_TIME", "", MIN_JOIN_LEAVE_TIME,
|
||||
"Anti SpamBot Parameter"},
|
||||
{
|
||||
"MIN_JOIN_LEAVE_TIME", "", MIN_JOIN_LEAVE_TIME,
|
||||
"Anti SpamBot Parameter"
|
||||
},
|
||||
|
||||
#ifdef MPATH
|
||||
{"MPATH", MPATH, 0, "Path to MOTD File"},
|
||||
|
@ -103,8 +114,10 @@ Info MyInformation[] = {
|
|||
{"MPATH", "NONE", 0, "Path to MOTD File"},
|
||||
#endif /* MPATH */
|
||||
|
||||
{"NICKNAMEHISTORYLENGTH", "", NICKNAMEHISTORYLENGTH,
|
||||
"Size of WHOWAS Array"},
|
||||
{
|
||||
"NICKNAMEHISTORYLENGTH", "", NICKNAMEHISTORYLENGTH,
|
||||
"Size of WHOWAS Array"
|
||||
},
|
||||
|
||||
#ifdef OPATH
|
||||
{"OPATH", OPATH, 0, "Path to Operator MOTD File"},
|
||||
|
@ -112,8 +125,10 @@ Info MyInformation[] = {
|
|||
{"OPATH", "NONE", 0, "Path to Operator MOTD File"},
|
||||
#endif /* OPATH */
|
||||
|
||||
{"OPER_SPAM_COUNTDOWN", "", OPER_SPAM_COUNTDOWN,
|
||||
"Anti SpamBot Parameter"},
|
||||
{
|
||||
"OPER_SPAM_COUNTDOWN", "", OPER_SPAM_COUNTDOWN,
|
||||
"Anti SpamBot Parameter"
|
||||
},
|
||||
|
||||
#ifdef HAVE_LIBCRYPTO
|
||||
{"HAVE_LIBCRYPTO", "ON", 0, "Enable OpenSSL CHALLENGE Support"},
|
||||
|
@ -141,10 +156,14 @@ Info MyInformation[] = {
|
|||
{"SPATH", "NONE", 0, "Path to Server Executable"},
|
||||
#endif /* SPATH */
|
||||
|
||||
{"TS_MAX_DELTA_DEFAULT", "", TS_MAX_DELTA_DEFAULT,
|
||||
"Maximum Allowed TS Delta from another Server"},
|
||||
{"TS_WARN_DELTA_DEFAULT", "", TS_WARN_DELTA_DEFAULT,
|
||||
"Maximum TS Delta before Sending Warning"},
|
||||
{
|
||||
"TS_MAX_DELTA_DEFAULT", "", TS_MAX_DELTA_DEFAULT,
|
||||
"Maximum Allowed TS Delta from another Server"
|
||||
},
|
||||
{
|
||||
"TS_WARN_DELTA_DEFAULT", "", TS_WARN_DELTA_DEFAULT,
|
||||
"Maximum TS Delta before Sending Warning"
|
||||
},
|
||||
#ifdef USE_IODEBUG_HOOKS
|
||||
{"USE_IODEBUG_HOOKS", "YES", 0, "IO Debugging support"},
|
||||
#else
|
||||
|
|
|
@ -41,8 +41,7 @@
|
|||
#include "msg.h"
|
||||
#include "hook.h"
|
||||
|
||||
struct module
|
||||
{
|
||||
struct module {
|
||||
char *name;
|
||||
const char *version;
|
||||
void *address;
|
||||
|
@ -51,8 +50,7 @@ struct module
|
|||
void * mapi_header; /* actually struct mapi_mheader_av<mapi_version> */
|
||||
};
|
||||
|
||||
struct module_path
|
||||
{
|
||||
struct module_path {
|
||||
char path[MAXPATHLEN];
|
||||
};
|
||||
|
||||
|
@ -65,20 +63,17 @@ struct module_path
|
|||
|
||||
typedef struct Message* mapi_clist_av1;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
const char * hapi_name;
|
||||
int * hapi_id;
|
||||
} mapi_hlist_av1;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
const char * hapi_name;
|
||||
hookfn fn;
|
||||
} mapi_hfn_list_av1;
|
||||
|
||||
struct mapi_mheader_av1
|
||||
{
|
||||
struct mapi_mheader_av1 {
|
||||
int mapi_version; /* Module API version */
|
||||
int (*mapi_register) (void); /* Register function;
|
||||
ret -1 = failure (unload) */
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
|
||||
struct rb_bh;
|
||||
|
||||
struct monitor
|
||||
{
|
||||
struct monitor {
|
||||
struct monitor *hnext;
|
||||
char name[NICKLEN];
|
||||
rb_dlink_list users;
|
||||
|
|
|
@ -31,8 +31,7 @@
|
|||
struct Client;
|
||||
|
||||
/* MessageHandler */
|
||||
typedef enum HandlerType
|
||||
{
|
||||
typedef enum HandlerType {
|
||||
UNREGISTERED_HANDLER,
|
||||
CLIENT_HANDLER,
|
||||
RCLIENT_HANDLER,
|
||||
|
@ -50,15 +49,13 @@ HandlerType;
|
|||
*/
|
||||
typedef int (*MessageHandler) (struct Client *, struct Client *, int, const char *[]);
|
||||
|
||||
struct MessageEntry
|
||||
{
|
||||
struct MessageEntry {
|
||||
MessageHandler handler;
|
||||
int min_para;
|
||||
};
|
||||
|
||||
/* Message table structure */
|
||||
struct Message
|
||||
{
|
||||
struct Message {
|
||||
const char *cmd;
|
||||
unsigned int count; /* number of times command used */
|
||||
unsigned int rcount; /* number of times command used by server */
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
#ifndef _NEWCONF_H_INCLUDED
|
||||
#define _NEWCONF_H_INCLUDED
|
||||
|
||||
struct ConfEntry
|
||||
{
|
||||
struct ConfEntry {
|
||||
const char *cf_name;
|
||||
int cf_type;
|
||||
void (*cf_func) (void *);
|
||||
|
@ -14,8 +13,7 @@ struct ConfEntry
|
|||
void *cf_arg;
|
||||
};
|
||||
|
||||
struct TopConf
|
||||
{
|
||||
struct TopConf {
|
||||
const char *tc_name;
|
||||
int (*tc_sfunc) (struct TopConf *);
|
||||
int (*tc_efunc) (struct TopConf *);
|
||||
|
@ -37,12 +35,10 @@ struct TopConf
|
|||
#define CF_FLIST 0x1000
|
||||
#define CF_MFLAG 0xFF00
|
||||
|
||||
typedef struct conf_parm_t_stru
|
||||
{
|
||||
typedef struct conf_parm_t_stru {
|
||||
struct conf_parm_t_stru *next;
|
||||
int type;
|
||||
union
|
||||
{
|
||||
union {
|
||||
char *string;
|
||||
int number;
|
||||
struct conf_parm_t_stru *list;
|
||||
|
|
|
@ -18,14 +18,12 @@
|
|||
*/
|
||||
#define IRCD_MAXNS 10
|
||||
|
||||
struct DNSReply
|
||||
{
|
||||
struct DNSReply {
|
||||
char *h_name;
|
||||
struct rb_sockaddr_storage addr;
|
||||
};
|
||||
|
||||
struct DNSQuery
|
||||
{
|
||||
struct DNSQuery {
|
||||
void *ptr; /* pointer used by callback to identify request */
|
||||
void (*callback)(void* vptr, struct DNSReply *reply); /* callback to call */
|
||||
};
|
||||
|
|
|
@ -34,8 +34,7 @@
|
|||
#define RRFIXEDSZ 10
|
||||
#define HFIXEDSZ 12
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
unsigned id :16; /* query identification number */
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
/* fields in third byte */
|
||||
|
|
|
@ -43,8 +43,7 @@ struct hostent;
|
|||
/* used by new parser */
|
||||
/* yacc/lex love globals!!! */
|
||||
|
||||
struct ip_value
|
||||
{
|
||||
struct ip_value {
|
||||
struct rb_sockaddr_storage ip;
|
||||
int ip_mask;
|
||||
int type;
|
||||
|
@ -53,13 +52,11 @@ struct ip_value
|
|||
extern FILE *conf_fbfile_in;
|
||||
extern char conf_line_in[256];
|
||||
|
||||
struct ConfItem
|
||||
{
|
||||
struct ConfItem {
|
||||
unsigned int status; /* If CONF_ILLEGAL, delete when no clients */
|
||||
unsigned int flags;
|
||||
int clients; /* Number of *LOCAL* clients using this */
|
||||
union
|
||||
{
|
||||
union {
|
||||
char *name; /* IRC name, nick, server name, or original u@h */
|
||||
const char *oper;
|
||||
} info;
|
||||
|
@ -137,8 +134,7 @@ struct ConfItem
|
|||
|
||||
/* flag definitions for opers now in client.h */
|
||||
|
||||
struct config_file_entry
|
||||
{
|
||||
struct config_file_entry {
|
||||
const char *dpath; /* DPATH if set from command line */
|
||||
const char *configfile;
|
||||
|
||||
|
@ -236,8 +232,7 @@ struct config_file_entry
|
|||
int away_interval;
|
||||
};
|
||||
|
||||
struct config_channel_entry
|
||||
{
|
||||
struct config_channel_entry {
|
||||
char * autochanmodes;
|
||||
char * exemptchanops;
|
||||
char * disabledmodes;
|
||||
|
@ -276,16 +271,14 @@ struct config_channel_entry
|
|||
int exempt_cmode_K;
|
||||
};
|
||||
|
||||
struct config_server_hide
|
||||
{
|
||||
struct config_server_hide {
|
||||
int flatten_links;
|
||||
int links_delay;
|
||||
int hidden;
|
||||
int disable_hidden;
|
||||
};
|
||||
|
||||
struct server_info
|
||||
{
|
||||
struct server_info {
|
||||
char *name;
|
||||
char sid[4];
|
||||
char *description;
|
||||
|
@ -310,15 +303,13 @@ struct server_info
|
|||
int ssld_count;
|
||||
};
|
||||
|
||||
struct admin_info
|
||||
{
|
||||
struct admin_info {
|
||||
char *name;
|
||||
char *description;
|
||||
char *email;
|
||||
};
|
||||
|
||||
struct alias_entry
|
||||
{
|
||||
struct alias_entry {
|
||||
char *name;
|
||||
char *target;
|
||||
int flags; /* reserved for later use */
|
||||
|
@ -339,8 +330,7 @@ extern rb_dlink_list service_list;
|
|||
|
||||
extern rb_dlink_list prop_bans;
|
||||
|
||||
typedef enum temp_list
|
||||
{
|
||||
typedef enum temp_list {
|
||||
TEMP_MIN,
|
||||
TEMP_HOUR,
|
||||
TEMP_DAY,
|
||||
|
|
|
@ -59,8 +59,7 @@ extern void init_s_newconf(void);
|
|||
extern void clear_s_newconf(void);
|
||||
extern void clear_s_newconf_bans(void);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
char *ip;
|
||||
time_t expiry;
|
||||
rb_patricia_node_t *pnode;
|
||||
|
@ -71,8 +70,7 @@ void add_tgchange(const char *host);
|
|||
tgchange *find_tgchange(const char *host);
|
||||
|
||||
/* shared/cluster/hub/leaf confs */
|
||||
struct remote_conf
|
||||
{
|
||||
struct remote_conf {
|
||||
char *username;
|
||||
char *host;
|
||||
char *server;
|
||||
|
@ -107,8 +105,7 @@ struct remote_conf
|
|||
#define CONF_HUB 0x0001
|
||||
#define CONF_LEAF 0x0002
|
||||
|
||||
struct oper_conf
|
||||
{
|
||||
struct oper_conf {
|
||||
char *name;
|
||||
char *username;
|
||||
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);
|
||||
|
||||
struct server_conf
|
||||
{
|
||||
struct server_conf {
|
||||
char *name;
|
||||
char *host;
|
||||
char *passwd;
|
||||
|
@ -240,8 +236,7 @@ extern int valid_wild_card_simple(const char *);
|
|||
extern int clean_resv_nick(const char *);
|
||||
time_t valid_temp_time(const char *p);
|
||||
|
||||
struct nd_entry
|
||||
{
|
||||
struct nd_entry {
|
||||
char name[NICKLEN+1];
|
||||
time_t expire;
|
||||
rb_dlink_node lnode; /* node in ll */
|
||||
|
|
|
@ -46,8 +46,7 @@ struct server_conf;
|
|||
struct Channel;
|
||||
|
||||
/* Capabilities */
|
||||
struct Capability
|
||||
{
|
||||
struct Capability {
|
||||
const char *name; /* name of capability */
|
||||
unsigned int cap; /* mask value */
|
||||
unsigned int required; /* 1 if required, 0 if not */
|
||||
|
|
|
@ -39,8 +39,7 @@ struct Client;
|
|||
/*
|
||||
* statistics structures
|
||||
*/
|
||||
struct ServerStatistics
|
||||
{
|
||||
struct ServerStatistics {
|
||||
unsigned int is_cl; /* number of client connections */
|
||||
unsigned int is_sv; /* number of server connections */
|
||||
unsigned int is_ni; /* connection but no idea who it was */
|
||||
|
|
|
@ -240,7 +240,7 @@
|
|||
/* Directory where binaries the IRCd itself spawns live */
|
||||
#undef PKGLIBEXECDIR
|
||||
|
||||
/* Directory in which to store state, such as band database */
|
||||
/* Directory in which to store state, such as ban database */
|
||||
#undef PKGLOCALSTATEDIR
|
||||
|
||||
/* Directory to store pidfile in. */
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
# include <alloca.h>
|
||||
# else
|
||||
# ifdef _AIX
|
||||
#pragma alloca
|
||||
#pragma alloca
|
||||
# else
|
||||
# ifndef alloca /* predefined by HP cc +Olibcalls */
|
||||
char *alloca ();
|
||||
|
|
|
@ -45,8 +45,7 @@ struct Client;
|
|||
also removed away information. *tough*
|
||||
- Dianora
|
||||
*/
|
||||
struct Whowas
|
||||
{
|
||||
struct Whowas {
|
||||
int hashv;
|
||||
char name[NICKLEN + 1];
|
||||
char username[USERLEN + 1];
|
||||
|
@ -93,8 +92,8 @@ void off_history(struct Client *);
|
|||
** one found...
|
||||
*/
|
||||
struct Client *get_history(const char *, time_t);
|
||||
/* Nick name */
|
||||
/* Time limit in seconds */
|
||||
/* Nick name */
|
||||
/* Time limit in seconds */
|
||||
|
||||
/*
|
||||
** for debugging...counts related structures stored in whowas array.
|
||||
|
|
|
@ -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@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
@ -16,6 +15,51 @@
|
|||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
|
@ -35,12 +79,12 @@ POST_UNINSTALL = :
|
|||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = .
|
||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/libratbox.pc.in \
|
||||
$(top_srcdir)/configure \
|
||||
$(top_srcdir)/include/libratbox_config.h.in COPYING ChangeLog \
|
||||
INSTALL TODO config.guess config.sub depcomp install-sh \
|
||||
ltmain.sh missing
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
|
||||
$(top_srcdir)/configure $(am__configure_deps) \
|
||||
$(top_srcdir)/include/libratbox_config.h.in \
|
||||
$(srcdir)/libratbox.pc.in COPYING ChangeLog INSTALL README \
|
||||
TODO compile config.guess config.sub depcomp install-sh \
|
||||
missing ltmain.sh
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
|
@ -52,15 +96,33 @@ mkinstalldirs = $(install_sh) -d
|
|||
CONFIG_HEADER = $(top_builddir)/include/libratbox_config.h
|
||||
CONFIG_CLEAN_FILES = libratbox.pc
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-dvi-recursive install-exec-recursive \
|
||||
install-html-recursive install-info-recursive \
|
||||
install-pdf-recursive install-ps-recursive install-recursive \
|
||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||
ps-recursive uninstall-recursive
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
|
||||
ctags-recursive dvi-recursive html-recursive info-recursive \
|
||||
install-data-recursive install-dvi-recursive \
|
||||
install-exec-recursive install-html-recursive \
|
||||
install-info-recursive install-pdf-recursive \
|
||||
install-ps-recursive install-recursive installcheck-recursive \
|
||||
installdirs-recursive pdf-recursive ps-recursive \
|
||||
tags-recursive uninstall-recursive
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
|
@ -82,23 +144,53 @@ am__nobase_list = $(am__nobase_strip_setup); \
|
|||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
|
||||
DATA = $(pkgconfig_DATA)
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
|
||||
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
|
||||
distdir dist dist-all distcheck
|
||||
am__recursive_targets = \
|
||||
$(RECURSIVE_TARGETS) \
|
||||
$(RECURSIVE_CLEAN_TARGETS) \
|
||||
$(am__extra_recursive_targets)
|
||||
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
|
||||
cscope distdir dist dist-all distcheck
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
CSCOPE = cscope
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
{ test ! -d "$(distdir)" \
|
||||
|| { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr "$(distdir)"; }; }
|
||||
if test -d "$(distdir)"; then \
|
||||
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -rf "$(distdir)" \
|
||||
|| { sleep 5 && rm -rf "$(distdir)"; }; \
|
||||
else :; fi
|
||||
am__post_remove_distdir = $(am__remove_distdir)
|
||||
am__relativize = \
|
||||
dir0=`pwd`; \
|
||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
||||
|
@ -126,11 +218,15 @@ am__relativize = \
|
|||
reldir="$$dir2"
|
||||
DIST_ARCHIVES = $(distdir).tar.gz
|
||||
GZIP_ENV = --best
|
||||
DIST_TARGETS = dist-gzip
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
|
||||
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
|
@ -266,7 +362,7 @@ pkgconfig_DATA = libratbox.pc
|
|||
all: all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
am--refresh:
|
||||
am--refresh: Makefile
|
||||
@:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
|
@ -302,10 +398,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
|||
$(am__aclocal_m4_deps):
|
||||
|
||||
include/libratbox_config.h: include/stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f include/stamp-h1; \
|
||||
$(MAKE) $(AM_MAKEFLAGS) include/stamp-h1; \
|
||||
else :; fi
|
||||
@test -f $@ || rm -f include/stamp-h1
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) include/stamp-h1
|
||||
|
||||
include/stamp-h1: $(top_srcdir)/include/libratbox_config.h.in $(top_builddir)/config.status
|
||||
@rm -f include/stamp-h1
|
||||
|
@ -330,8 +424,11 @@ distclean-libtool:
|
|||
-rm -f libtool config.lt
|
||||
install-pkgconfigDATA: $(pkgconfig_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
|
||||
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
|
@ -345,27 +442,28 @@ uninstall-pkgconfigDATA:
|
|||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
test -n "$$files" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files
|
||||
dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@fail= failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
# into them and run 'make' without going through this Makefile.
|
||||
# To change the values of 'make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in 'config.status', edit 'config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run 'make');
|
||||
# (2) otherwise, pass the desired values on the 'make' command line.
|
||||
$(am__recursive_targets):
|
||||
@fail=; \
|
||||
if $(am__make_keepgoing); then \
|
||||
failcom='fail=yes'; \
|
||||
else \
|
||||
failcom='exit 1'; \
|
||||
fi; \
|
||||
dot_seen=no; \
|
||||
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"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
|
@ -380,57 +478,12 @@ $(RECURSIVE_TARGETS):
|
|||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
$(RECURSIVE_CLEAN_TARGETS):
|
||||
@fail= failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-recursive
|
||||
TAGS: tags
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
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"; \
|
||||
fi; \
|
||||
done; \
|
||||
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; }; }'`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
|
@ -463,15 +511,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
|||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
ctags: ctags-recursive
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
@ -480,9 +524,31 @@ GTAGS:
|
|||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscope: cscope.files
|
||||
test ! -s cscope.files \
|
||||
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
|
||||
clean-cscope:
|
||||
-rm -f cscope.files
|
||||
cscope.files: clean-cscope cscopelist
|
||||
cscopelist: cscopelist-recursive
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
|
@ -518,13 +584,10 @@ distdir: $(DISTFILES)
|
|||
done
|
||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
$(am__make_dryrun) \
|
||||
|| test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
||||
$(am__relativize); \
|
||||
new_distdir=$$reldir; \
|
||||
|
@ -553,36 +616,42 @@ distdir: $(DISTFILES)
|
|||
|| chmod -R a+r "$(distdir)"
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-lzma: distdir
|
||||
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
|
||||
$(am__remove_distdir)
|
||||
dist-lzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-xz: distdir
|
||||
tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
|
||||
$(am__remove_distdir)
|
||||
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
@echo WARNING: "Support for shar distribution archives is" \
|
||||
"deprecated." >&2
|
||||
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
@echo WARNING: "Support for distribution archives compressed with" \
|
||||
"legacy program 'compress' is deprecated." >&2
|
||||
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__remove_distdir)
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
dist dist-all:
|
||||
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
|
@ -593,8 +662,8 @@ distcheck: dist
|
|||
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.lzma*) \
|
||||
lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
|
||||
*.tar.lz*) \
|
||||
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
|
||||
*.tar.xz*) \
|
||||
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
|
@ -604,17 +673,19 @@ distcheck: dist
|
|||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod -R a-w $(distdir)
|
||||
chmod u+w $(distdir)
|
||||
mkdir $(distdir)/_build $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
test -d $(distdir)/_build || exit 0; \
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& am__cwd=`pwd` \
|
||||
&& $(am__cd) $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
&& ../configure \
|
||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
--srcdir=.. --prefix="$$dc_install_base" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
|
@ -637,13 +708,21 @@ distcheck: dist
|
|||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
|
||||
&& cd "$$am__cwd" \
|
||||
|| exit 1
|
||||
$(am__remove_distdir)
|
||||
$(am__post_remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
||||
distuninstallcheck:
|
||||
@$(am__cd) '$(distuninstallcheck_dir)' \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
@test -n '$(distuninstallcheck_dir)' || { \
|
||||
echo 'ERROR: trying to run $@ with an empty' \
|
||||
'$$(distuninstallcheck_dir)' >&2; \
|
||||
exit 1; \
|
||||
}; \
|
||||
$(am__cd) '$(distuninstallcheck_dir)' || { \
|
||||
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
|
||||
exit 1; \
|
||||
}; \
|
||||
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
|
@ -677,10 +756,15 @@ install-am: all-am
|
|||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
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:
|
||||
|
||||
clean-generic:
|
||||
|
@ -762,25 +846,24 @@ ps-am:
|
|||
|
||||
uninstall-am: uninstall-pkgconfigDATA
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
|
||||
install-am install-strip tags-recursive
|
||||
.MAKE: $(am__recursive_targets) install-am install-strip
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am am--refresh check check-am clean clean-generic \
|
||||
clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
|
||||
dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
|
||||
distcheck distclean distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags distcleancheck distdir \
|
||||
distuninstallcheck dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-pkgconfigDATA install-ps \
|
||||
install-ps-am install-strip installcheck installcheck-am \
|
||||
installdirs installdirs-am maintainer-clean \
|
||||
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
|
||||
am--refresh check check-am clean clean-cscope clean-generic \
|
||||
clean-libtool cscope cscopelist-am ctags ctags-am dist \
|
||||
dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
|
||||
dist-xz dist-zip distcheck distclean distclean-generic \
|
||||
distclean-hdr distclean-libtool distclean-tags distcleancheck \
|
||||
distdir distuninstallcheck dvi dvi-am html html-am info \
|
||||
info-am install install-am install-data install-data-am \
|
||||
install-dvi install-dvi-am install-exec install-exec-am \
|
||||
install-html install-html-am install-info install-info-am \
|
||||
install-man install-pdf install-pdf-am install-pkgconfigDATA \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs installdirs-am maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
|
||||
uninstall uninstall-am uninstall-pkgconfigDATA
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
|
||||
uninstall-am uninstall-pkgconfigDATA
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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:
|
File diff suppressed because it is too large
Load Diff
|
@ -44,13 +44,13 @@
|
|||
#ifdef HAVE_WRITEV
|
||||
#ifndef UIO_MAXIOV
|
||||
# if defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
|
||||
/* FreeBSD 4.7 defines it in sys/uio.h only if _KERNEL is specified */
|
||||
/* FreeBSD 4.7 defines it in sys/uio.h only if _KERNEL is specified */
|
||||
# define RB_UIO_MAXIOV 1024
|
||||
# elif defined(__sgi)
|
||||
/* IRIX 6.5 has sysconf(_SC_IOV_MAX) which might return 512 or bigger */
|
||||
/* IRIX 6.5 has sysconf(_SC_IOV_MAX) which might return 512 or bigger */
|
||||
# define RB_UIO_MAXIOV 512
|
||||
# elif defined(__sun)
|
||||
/* Solaris (and SunOS?) defines IOV_MAX instead */
|
||||
/* Solaris (and SunOS?) defines IOV_MAX instead */
|
||||
# ifndef IOV_MAX
|
||||
# define RB_UIO_MAXIOV 16
|
||||
# else
|
||||
|
@ -68,8 +68,7 @@
|
|||
#else
|
||||
#define RB_UIO_MAXIOV 16
|
||||
#endif
|
||||
struct conndata
|
||||
{
|
||||
struct conndata {
|
||||
/* We don't need the host here ? */
|
||||
struct rb_sockaddr_storage S;
|
||||
struct rb_sockaddr_storage hostaddr;
|
||||
|
@ -79,8 +78,7 @@ struct conndata
|
|||
/* We'd also add the retry count here when we get to that -- adrian */
|
||||
};
|
||||
|
||||
struct acceptdata
|
||||
{
|
||||
struct acceptdata {
|
||||
struct rb_sockaddr_storage S;
|
||||
rb_socklen_t addrlen;
|
||||
ACCB *callback;
|
||||
|
@ -95,8 +93,7 @@ struct acceptdata
|
|||
#define ClearFDOpen(F) (F->flags &= ~FLAG_OPEN)
|
||||
|
||||
|
||||
struct _fde
|
||||
{
|
||||
struct _fde {
|
||||
/* New-school stuff, again pretty much ripped from squid */
|
||||
/*
|
||||
* Yes, this gives us only one pending read and one pending write per
|
||||
|
@ -123,8 +120,7 @@ struct _fde
|
|||
typedef void (*comm_event_cb_t) (void *);
|
||||
|
||||
#ifdef USE_TIMER_CREATE
|
||||
typedef struct timer_data
|
||||
{
|
||||
typedef struct timer_data {
|
||||
timer_t td_timer_id;
|
||||
comm_event_cb_t td_cb;
|
||||
void *td_udata;
|
||||
|
@ -148,8 +144,7 @@ rb_find_fd(int fd)
|
|||
if(hlist->head == NULL)
|
||||
return NULL;
|
||||
|
||||
RB_DLINK_FOREACH(ptr, hlist->head)
|
||||
{
|
||||
RB_DLINK_FOREACH(ptr, hlist->head) {
|
||||
rb_fde_t *F = ptr->data;
|
||||
if(F->fd == fd)
|
||||
return F;
|
||||
|
|
|
@ -22,8 +22,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
struct ev_entry
|
||||
{
|
||||
struct ev_entry {
|
||||
rb_dlink_node node;
|
||||
EVH *func;
|
||||
void *arg;
|
||||
|
|
|
@ -60,6 +60,9 @@
|
|||
/* Define to 1 if you have the `gmtime_r' function. */
|
||||
#undef HAVE_GMTIME_R
|
||||
|
||||
/* Has GnuTLS */
|
||||
#undef HAVE_GNUTLS
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
|
|
|
@ -48,8 +48,7 @@ typedef void ACCB(rb_fde_t *, int status, struct sockaddr *addr, rb_socklen_t le
|
|||
/* callback for pre-accept callback */
|
||||
typedef int ACPRE(rb_fde_t *, struct sockaddr *addr, rb_socklen_t len, void *);
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
RB_OK,
|
||||
RB_ERR_BIND,
|
||||
RB_ERR_DNS,
|
||||
|
@ -78,8 +77,7 @@ enum
|
|||
#define RB_RW_SSL_NEED_WRITE -4 /* SSL Needs write */
|
||||
|
||||
|
||||
struct rb_iovec
|
||||
{
|
||||
struct rb_iovec {
|
||||
void *iov_base;
|
||||
size_t iov_len;
|
||||
};
|
||||
|
@ -154,8 +152,7 @@ uint8_t rb_get_type(rb_fde_t *F);
|
|||
|
||||
const char *rb_get_iotype(void);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
RB_PRNG_EGD,
|
||||
RB_PRNG_FILE,
|
||||
#ifdef _WIN32
|
||||
|
|
|
@ -47,8 +47,8 @@ void rb_helper_restart(rb_helper *helper);
|
|||
void
|
||||
rb_helper_write(rb_helper *helper, const char *format, ...)
|
||||
__attribute((format(printf, 2, 3)));
|
||||
void rb_helper_write_queue(rb_helper *helper, const char *format, ...)
|
||||
__attribute((format(printf, 2, 3)));
|
||||
void rb_helper_write_queue(rb_helper *helper, const char *format, ...)
|
||||
__attribute((format(printf, 2, 3)));
|
||||
#else
|
||||
void rb_helper_write(rb_helper *helper, const char *format, ...);
|
||||
void rb_helper_write_queue(rb_helper *helper, const char *format, ...);
|
||||
|
|
|
@ -41,8 +41,7 @@ struct _buf_head;
|
|||
/* How big we want a buffer - 510 data bytes, plus space for a '\0' */
|
||||
#define BUF_DATA_SIZE 511
|
||||
|
||||
typedef struct _buf_line
|
||||
{
|
||||
typedef struct _buf_line {
|
||||
char buf[BUF_DATA_SIZE + 2];
|
||||
uint8_t terminated; /* Whether we've terminated the buffer */
|
||||
uint8_t raw; /* Whether this linebuf may hold 8-bit data */
|
||||
|
@ -50,8 +49,7 @@ typedef struct _buf_line
|
|||
int refcount; /* how many linked lists are we in? */
|
||||
} buf_line_t;
|
||||
|
||||
typedef struct _buf_head
|
||||
{
|
||||
typedef struct _buf_head {
|
||||
rb_dlink_list list; /* the actual dlink list */
|
||||
int len; /* length of all the data */
|
||||
int alloclen; /* Actual allocated data length */
|
||||
|
|
|
@ -29,13 +29,11 @@
|
|||
#define MAXLINE 1024
|
||||
#define BIT_TEST(f, b) ((f) & (b))
|
||||
|
||||
typedef struct _rb_prefix_t
|
||||
{
|
||||
typedef struct _rb_prefix_t {
|
||||
unsigned short family; /* AF_INET | AF_INET6 */
|
||||
unsigned short bitlen; /* same as mask? */
|
||||
int ref_count; /* reference count */
|
||||
union
|
||||
{
|
||||
union {
|
||||
struct in_addr sin;
|
||||
#ifdef RB_IPV6
|
||||
struct in6_addr sin6;
|
||||
|
@ -46,8 +44,7 @@ typedef struct _rb_prefix_t
|
|||
rb_prefix_t;
|
||||
|
||||
|
||||
typedef struct _rb_patricia_node_t
|
||||
{
|
||||
typedef struct _rb_patricia_node_t {
|
||||
unsigned int bit; /* flag if this node used */
|
||||
rb_prefix_t *prefix; /* who we are in patricia tree */
|
||||
struct _rb_patricia_node_t *l, *r; /* left and right children */
|
||||
|
@ -56,8 +53,7 @@ typedef struct _rb_patricia_node_t
|
|||
}
|
||||
rb_patricia_node_t;
|
||||
|
||||
typedef struct _rb_patricia_tree_t
|
||||
{
|
||||
typedef struct _rb_patricia_tree_t {
|
||||
rb_patricia_node_t *head;
|
||||
unsigned int maxbits; /* for IP, 32 bit addresses */
|
||||
int num_active_node; /* for debug purpose */
|
||||
|
|
|
@ -38,26 +38,9 @@
|
|||
/*
|
||||
* rb_sprintf - optimized sprintf
|
||||
*/
|
||||
#ifdef __GNUC__
|
||||
int
|
||||
rb_sprintf(char *str, const char *fmt, ...)
|
||||
__attribute((format(printf, 2, 3)));
|
||||
int rb_snprintf(char *str, const size_t size, const char *, ...)
|
||||
__attribute__ ((format(printf, 3, 4)));
|
||||
int rb_sprintf_append(char *str, const char *format, ...) __attribute((format(printf, 2, 3)));
|
||||
int rb_snprintf_append(char *str, size_t len, const char *format, ...)
|
||||
__attribute__ ((format(printf, 3, 4)));
|
||||
#else
|
||||
int rb_sprintf(char *str, const char *format, ...);
|
||||
int rb_snprintf(char *str, const size_t size, const char *, ...);
|
||||
int rb_sprintf_append(char *str, const char *format, ...);
|
||||
int rb_snprintf_append(char *str, const size_t size, const char *, ...);
|
||||
|
||||
#endif
|
||||
|
||||
int rb_vsnprintf(char *str, const size_t size, const char *fmt, va_list args);
|
||||
int rb_vsprintf(char *str, const char *fmt, va_list args);
|
||||
int rb_vsnprintf_append(char *str, const size_t size, const char *fmt, va_list args);
|
||||
int rb_vsprintf_append(char *str, const char *fmt, va_list args);
|
||||
int sprintf_append(char *str, const char *format, ...);
|
||||
int snprintf_append(char *str, const size_t size, const char *, ...);
|
||||
int vsnprintf_append(char *str, const size_t size, const char *fmt, va_list args);
|
||||
int vsprintf_append(char *str, const char *fmt, va_list args);
|
||||
|
||||
#endif /* SPRINTF_IRC */
|
||||
|
|
|
@ -44,16 +44,14 @@ int rb_string_to_array(char *string, char **parv, int maxpara);
|
|||
typedef struct _rb_dlink_node rb_dlink_node;
|
||||
typedef struct _rb_dlink_list rb_dlink_list;
|
||||
|
||||
struct _rb_dlink_node
|
||||
{
|
||||
struct _rb_dlink_node {
|
||||
void *data;
|
||||
rb_dlink_node *prev;
|
||||
rb_dlink_node *next;
|
||||
|
||||
};
|
||||
|
||||
struct _rb_dlink_list
|
||||
{
|
||||
struct _rb_dlink_list {
|
||||
rb_dlink_node *head;
|
||||
rb_dlink_node *tail;
|
||||
unsigned long length;
|
||||
|
@ -161,12 +159,9 @@ rb_dlinkAddBefore(rb_dlink_node *b, void *data, rb_dlink_node *m, rb_dlink_list
|
|||
assert(list != NULL);
|
||||
|
||||
/* Shortcut - if its the first one, call rb_dlinkAdd only */
|
||||
if(b == list->head)
|
||||
{
|
||||
if(b == list->head) {
|
||||
rb_dlinkAdd(data, m, list);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
m->data = data;
|
||||
b->prev->next = m;
|
||||
m->prev = b->prev;
|
||||
|
@ -251,8 +246,7 @@ rb_dlinkFindDelete(void *data, rb_dlink_list *list)
|
|||
rb_dlink_node *m;
|
||||
assert(list != NULL);
|
||||
assert(data != NULL);
|
||||
RB_DLINK_FOREACH(m, list->head)
|
||||
{
|
||||
RB_DLINK_FOREACH(m, list->head) {
|
||||
if(m->data != data)
|
||||
continue;
|
||||
|
||||
|
@ -282,8 +276,7 @@ rb_dlinkFindDestroy(void *data, rb_dlink_list *list)
|
|||
assert(data != NULL);
|
||||
ptr = rb_dlinkFindDelete(data, list);
|
||||
|
||||
if(ptr != NULL)
|
||||
{
|
||||
if(ptr != NULL) {
|
||||
rb_free_rb_dlink_node(ptr);
|
||||
return 1;
|
||||
}
|
||||
|
@ -304,8 +297,7 @@ rb_dlinkFind(void *data, rb_dlink_list *list)
|
|||
assert(list != NULL);
|
||||
assert(data != NULL);
|
||||
|
||||
RB_DLINK_FOREACH(ptr, list->head)
|
||||
{
|
||||
RB_DLINK_FOREACH(ptr, list->head) {
|
||||
if(ptr->data == data)
|
||||
return (ptr);
|
||||
}
|
||||
|
@ -324,8 +316,7 @@ rb_dlinkMoveList(rb_dlink_list *from, rb_dlink_list *to)
|
|||
return;
|
||||
|
||||
/* case two, nothing in to list */
|
||||
if(to->head == NULL)
|
||||
{
|
||||
if(to->head == NULL) {
|
||||
to->head = from->head;
|
||||
to->tail = from->tail;
|
||||
from->head = from->tail = NULL;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
# libtool (GNU libtool) 2.4
|
||||
# libtool (GNU libtool) 2.4.2
|
||||
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
|
||||
# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||
# This is free software; see the source for copying conditions. There is NO
|
||||
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
@ -41,6 +41,7 @@
|
|||
# --quiet, --silent don't print informational messages
|
||||
# --no-quiet, --no-silent
|
||||
# print informational messages (default)
|
||||
# --no-warn don't display warning messages
|
||||
# --tag=TAG use configuration variables from tag TAG
|
||||
# -v, --verbose print more informational messages than default
|
||||
# --no-verbose don't print the extra informational messages
|
||||
|
@ -69,7 +70,7 @@
|
|||
# compiler: $LTCC
|
||||
# compiler flags: $LTCFLAGS
|
||||
# linker: $LD (gnu? $with_gnu_ld)
|
||||
# $progname: (GNU libtool) 2.4
|
||||
# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1
|
||||
# automake: $automake_version
|
||||
# autoconf: $autoconf_version
|
||||
#
|
||||
|
@ -79,9 +80,9 @@
|
|||
|
||||
PROGRAM=libtool
|
||||
PACKAGE=libtool
|
||||
VERSION=2.4
|
||||
VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1"
|
||||
TIMESTAMP=""
|
||||
package_revision=1.3293
|
||||
package_revision=1.3337
|
||||
|
||||
# Be Bourne compatible
|
||||
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
|
||||
|
@ -136,15 +137,10 @@ progpath="$0"
|
|||
|
||||
: ${CP="cp -f"}
|
||||
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
|
||||
: ${EGREP="grep -E"}
|
||||
: ${FGREP="grep -F"}
|
||||
: ${GREP="grep"}
|
||||
: ${LN_S="ln -s"}
|
||||
: ${MAKE="make"}
|
||||
: ${MKDIR="mkdir"}
|
||||
: ${MV="mv -f"}
|
||||
: ${RM="rm -f"}
|
||||
: ${SED="sed"}
|
||||
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
|
||||
: ${Xsed="$SED -e 1s/^X//"}
|
||||
|
||||
|
@ -387,7 +383,7 @@ case $progpath in
|
|||
;;
|
||||
*)
|
||||
save_IFS="$IFS"
|
||||
IFS=:
|
||||
IFS=${PATH_SEPARATOR-:}
|
||||
for progdir in $PATH; do
|
||||
IFS="$save_IFS"
|
||||
test -x "$progdir/$progname" && break
|
||||
|
@ -771,8 +767,8 @@ func_help ()
|
|||
s*\$LTCFLAGS*'"$LTCFLAGS"'*
|
||||
s*\$LD*'"$LD"'*
|
||||
s/\$with_gnu_ld/'"$with_gnu_ld"'/
|
||||
s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
|
||||
s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
|
||||
s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
|
||||
s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
|
||||
p
|
||||
d
|
||||
}
|
||||
|
@ -1052,6 +1048,7 @@ opt_finish=false
|
|||
opt_help=false
|
||||
opt_help_all=false
|
||||
opt_silent=:
|
||||
opt_warning=:
|
||||
opt_verbose=:
|
||||
opt_silent=false
|
||||
opt_verbose=false
|
||||
|
@ -1118,6 +1115,10 @@ esac
|
|||
;;
|
||||
--no-silent|--no-quiet)
|
||||
opt_silent=false
|
||||
func_append preserve_args " $opt"
|
||||
;;
|
||||
--no-warning|--no-warn)
|
||||
opt_warning=false
|
||||
func_append preserve_args " $opt"
|
||||
;;
|
||||
--no-verbose)
|
||||
|
@ -2059,7 +2060,7 @@ func_mode_compile ()
|
|||
*.[cCFSifmso] | \
|
||||
*.ada | *.adb | *.ads | *.asm | \
|
||||
*.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
|
||||
*.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
|
||||
*.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
|
||||
func_xform "$libobj"
|
||||
libobj=$func_xform_result
|
||||
;;
|
||||
|
@ -3201,11 +3202,13 @@ func_mode_install ()
|
|||
|
||||
# Set up the ranlib parameters.
|
||||
oldlib="$destdir/$name"
|
||||
func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
|
||||
tool_oldlib=$func_to_tool_file_result
|
||||
|
||||
func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
|
||||
|
||||
if test -n "$stripme" && test -n "$old_striplib"; then
|
||||
func_show_eval "$old_striplib $oldlib" 'exit $?'
|
||||
func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
|
||||
fi
|
||||
|
||||
# Do each command in the postinstall commands.
|
||||
|
@ -3470,7 +3473,7 @@ static const void *lt_preloaded_setup() {
|
|||
# linked before any other PIC object. But we must not use
|
||||
# pic_flag when linking with -static. The problem exists in
|
||||
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
|
||||
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
|
||||
*-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
|
||||
pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
|
||||
*-*-hpux*)
|
||||
pic_flag_for_symtable=" $pic_flag" ;;
|
||||
|
@ -3982,6 +3985,8 @@ func_exec_program_core ()
|
|||
# launches target application with the remaining arguments.
|
||||
func_exec_program ()
|
||||
{
|
||||
case \" \$* \" in
|
||||
*\\ --lt-*)
|
||||
for lt_wr_arg
|
||||
do
|
||||
case \$lt_wr_arg in
|
||||
|
@ -3989,7 +3994,8 @@ func_exec_program ()
|
|||
*) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
done ;;
|
||||
esac
|
||||
func_exec_program_core \${1+\"\$@\"}
|
||||
}
|
||||
|
||||
|
@ -5057,9 +5063,15 @@ void lt_dump_script (FILE* f)
|
|||
{
|
||||
EOF
|
||||
func_emit_wrapper yes |
|
||||
$SED -e 's/\([\\"]\)/\\\1/g' \
|
||||
-e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
|
||||
|
||||
$SED -n -e '
|
||||
s/^\(.\{79\}\)\(..*\)/\1\
|
||||
\2/
|
||||
h
|
||||
s/\([\\"]\)/\\\1/g
|
||||
s/$/\\n/
|
||||
s/\([^\n]*\).*/ fputs ("\1", f);/p
|
||||
g
|
||||
D'
|
||||
cat <<"EOF"
|
||||
}
|
||||
EOF
|
||||
|
@ -5643,7 +5655,8 @@ func_mode_link ()
|
|||
continue
|
||||
;;
|
||||
|
||||
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
|
||||
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
|
||||
|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
|
||||
func_append compiler_flags " $arg"
|
||||
func_append compile_command " $arg"
|
||||
func_append finalize_command " $arg"
|
||||
|
@ -6111,7 +6124,10 @@ func_mode_link ()
|
|||
case $pass in
|
||||
dlopen) libs="$dlfiles" ;;
|
||||
dlpreopen) libs="$dlprefiles" ;;
|
||||
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
|
||||
link)
|
||||
libs="$deplibs %DEPLIBS%"
|
||||
test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test "$linkmode,$pass" = "lib,dlpreopen"; then
|
||||
|
@ -6147,7 +6163,8 @@ func_mode_link ()
|
|||
lib=
|
||||
found=no
|
||||
case $deplib in
|
||||
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
|
||||
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
|
||||
|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
|
||||
if test "$linkmode,$pass" = "prog,link"; then
|
||||
compile_deplibs="$deplib $compile_deplibs"
|
||||
finalize_deplibs="$deplib $finalize_deplibs"
|
||||
|
@ -6430,9 +6447,6 @@ func_mode_link ()
|
|||
# It is a libtool convenience library, so add in its objects.
|
||||
func_append convenience " $ladir/$objdir/$old_library"
|
||||
func_append old_convenience " $ladir/$objdir/$old_library"
|
||||
elif test "$linkmode" != prog && test "$linkmode" != lib; then
|
||||
func_fatal_error "\`$lib' is not a convenience library"
|
||||
fi
|
||||
tmp_libs=
|
||||
for deplib in $dependency_libs; do
|
||||
deplibs="$deplib $deplibs"
|
||||
|
@ -6443,6 +6457,9 @@ func_mode_link ()
|
|||
fi
|
||||
func_append tmp_libs " $deplib"
|
||||
done
|
||||
elif test "$linkmode" != prog && test "$linkmode" != lib; then
|
||||
func_fatal_error "\`$lib' is not a convenience library"
|
||||
fi
|
||||
continue
|
||||
fi # $pass = conv
|
||||
|
||||
|
@ -6831,7 +6848,7 @@ func_mode_link ()
|
|||
test "$hardcode_direct_absolute" = no; then
|
||||
add="$dir/$linklib"
|
||||
elif test "$hardcode_minus_L" = yes; then
|
||||
add_dir="-L$dir"
|
||||
add_dir="-L$absdir"
|
||||
# Try looking first in the location we're being installed to.
|
||||
if test -n "$inst_prefix_dir"; then
|
||||
case $libdir in
|
||||
|
@ -7316,6 +7333,7 @@ func_mode_link ()
|
|||
# which has an extra 1 added just for fun
|
||||
#
|
||||
case $version_type in
|
||||
# correct linux to gnu/linux during the next big refactor
|
||||
darwin|linux|osf|windows|none)
|
||||
func_arith $number_major + $number_minor
|
||||
current=$func_arith_result
|
||||
|
@ -7334,6 +7352,9 @@ func_mode_link ()
|
|||
revision="$number_minor"
|
||||
lt_irix_increment=no
|
||||
;;
|
||||
*)
|
||||
func_fatal_configuration "$modename: unknown library version type \`$version_type'"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
no)
|
||||
|
@ -7432,7 +7453,7 @@ func_mode_link ()
|
|||
versuffix="$major.$revision"
|
||||
;;
|
||||
|
||||
linux)
|
||||
linux) # correct to gnu/linux during the next big refactor
|
||||
func_arith $current - $age
|
||||
major=.$func_arith_result
|
||||
versuffix="$major.$age.$revision"
|
||||
|
@ -8020,6 +8041,11 @@ EOF
|
|||
|
||||
# Test again, we may have decided not to build it any more
|
||||
if test "$build_libtool_libs" = yes; then
|
||||
# Remove ${wl} instances when linking with ld.
|
||||
# FIXME: should test the right _cmds variable.
|
||||
case $archive_cmds in
|
||||
*\$LD\ *) wl= ;;
|
||||
esac
|
||||
if test "$hardcode_into_libs" = yes; then
|
||||
# Hardcode the library paths
|
||||
hardcode_libdirs=
|
||||
|
@ -8050,7 +8076,7 @@ EOF
|
|||
elif test -n "$runpath_var"; then
|
||||
case "$perm_rpath " in
|
||||
*" $libdir "*) ;;
|
||||
*) func_apped perm_rpath " $libdir" ;;
|
||||
*) func_append perm_rpath " $libdir" ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
|
@ -8058,11 +8084,7 @@ EOF
|
|||
if test -n "$hardcode_libdir_separator" &&
|
||||
test -n "$hardcode_libdirs"; then
|
||||
libdir="$hardcode_libdirs"
|
||||
if test -n "$hardcode_libdir_flag_spec_ld"; then
|
||||
eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
|
||||
else
|
||||
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
|
||||
fi
|
||||
eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
|
||||
fi
|
||||
if test -n "$runpath_var" && test -n "$perm_rpath"; then
|
||||
# We should set the runpath_var.
|
||||
|
@ -9152,6 +9174,8 @@ EOF
|
|||
esac
|
||||
done
|
||||
fi
|
||||
func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
|
||||
tool_oldlib=$func_to_tool_file_result
|
||||
eval cmds=\"$old_archive_cmds\"
|
||||
|
||||
func_len " $cmds"
|
||||
|
@ -9261,7 +9285,8 @@ EOF
|
|||
*.la)
|
||||
func_basename "$deplib"
|
||||
name="$func_basename_result"
|
||||
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
|
||||
func_resolve_sysroot "$deplib"
|
||||
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
|
||||
test -z "$libdir" && \
|
||||
func_fatal_error "\`$deplib' is not a valid libtool archive"
|
||||
func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
|
||||
|
|
|
@ -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@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
@ -18,6 +17,51 @@
|
|||
# $Id: Makefile.am 26046 2008-09-09 16:37:30Z androsyn $
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
|
@ -37,7 +81,8 @@ POST_UNINSTALL = :
|
|||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = src
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
|
||||
$(top_srcdir)/depcomp
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
|
@ -68,6 +113,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
|
|||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(libdir)"
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
libratbox_la_DEPENDENCIES =
|
||||
|
@ -77,30 +128,78 @@ am_libratbox_la_OBJECTS = unix.lo win32.lo crypt.lo balloc.lo \
|
|||
devpoll.lo epoll.lo poll.lo ports.lo sigio.lo select.lo \
|
||||
kqueue.lo rawbuf.lo patricia.lo arc4random.lo version.lo
|
||||
libratbox_la_OBJECTS = $(am_libratbox_la_OBJECTS)
|
||||
libratbox_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
am__v_lt_1 =
|
||||
libratbox_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(libratbox_la_LDFLAGS) $(LDFLAGS) -o $@
|
||||
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 =
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
AM_V_CC = $(am__v_CC_@AM_V@)
|
||||
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
|
||||
am__v_CC_0 = @echo " CC " $@;
|
||||
am__v_CC_1 =
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = $(libratbox_la_SOURCES)
|
||||
DIST_SOURCES = $(libratbox_la_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
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
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
|
@ -298,9 +397,9 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
|||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
|
||||
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
|
||||
list2=; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
|
@ -308,6 +407,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
|||
else :; fi; \
|
||||
done; \
|
||||
test -z "$$list2" || { \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
|
||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
|
||||
}
|
||||
|
@ -323,14 +424,17 @@ uninstall-libLTLIBRARIES:
|
|||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
|
||||
test "$$dir" != "$$p" || dir=.; \
|
||||
echo "rm -f \"$${dir}/so_locations\""; \
|
||||
rm -f "$${dir}/so_locations"; \
|
||||
done
|
||||
libratbox.la: $(libratbox_la_OBJECTS) $(libratbox_la_DEPENDENCIES)
|
||||
$(libratbox_la_LINK) -rpath $(libdir) $(libratbox_la_OBJECTS) $(libratbox_la_LIBADD) $(LIBS)
|
||||
@list='$(lib_LTLIBRARIES)'; \
|
||||
locs=`for p in $$list; do echo $$p; done | \
|
||||
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
|
||||
sort -u`; \
|
||||
test -z "$$locs" || { \
|
||||
echo rm -f $${locs}; \
|
||||
rm -f $${locs}; \
|
||||
}
|
||||
|
||||
libratbox.la: $(libratbox_la_OBJECTS) $(libratbox_la_DEPENDENCIES) $(EXTRA_libratbox_la_DEPENDENCIES)
|
||||
$(AM_V_CCLD)$(libratbox_la_LINK) -rpath $(libdir) $(libratbox_la_OBJECTS) $(libratbox_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
@ -366,25 +470,25 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/win32.Plo@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
@ -392,26 +496,15 @@ mostlyclean-libtool:
|
|||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-am
|
||||
TAGS: tags
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
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; }; }'`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
|
@ -423,15 +516,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
|||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
ctags: ctags-am
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
@ -440,6 +529,21 @@ GTAGS:
|
|||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscopelist: cscopelist-am
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
@ -493,10 +597,15 @@ install-am: all-am
|
|||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
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:
|
||||
|
||||
clean-generic:
|
||||
|
@ -582,19 +691,19 @@ uninstall-am: uninstall-libLTLIBRARIES
|
|||
|
||||
.MAKE: all check install install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libLTLIBRARIES clean-libtool ctags distclean \
|
||||
distclean-compile distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am \
|
||||
install-libLTLIBRARIES install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
|
||||
clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
|
||||
ctags-am distclean distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-libLTLIBRARIES install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-libLTLIBRARIES
|
||||
tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES
|
||||
|
||||
|
||||
version.c: version.c.SH ../CREDITS
|
||||
|
|
|
@ -40,8 +40,7 @@
|
|||
|
||||
|
||||
|
||||
struct arc4_stream
|
||||
{
|
||||
struct arc4_stream {
|
||||
uint8_t i;
|
||||
uint8_t j;
|
||||
uint8_t s[256];
|
||||
|
@ -75,8 +74,7 @@ arc4_addrandom(struct arc4_stream *as, uint8_t *dat, int datlen)
|
|||
uint8_t si;
|
||||
|
||||
as->i--;
|
||||
for(n = 0; n < 256; n++)
|
||||
{
|
||||
for(n = 0; n < 256; n++) {
|
||||
as->i = (as->i + 1);
|
||||
si = as->s[as->i];
|
||||
as->j = (as->j + si + dat[n % datlen]);
|
||||
|
@ -111,7 +109,8 @@ arc4_stir(struct arc4_stream *as)
|
|||
struct rusage buf;
|
||||
getrusage(RUSAGE_SELF, &buf);
|
||||
arc4_addrandom(as, (void *)&buf, sizeof(buf));
|
||||
memset(&buf, 0, sizeof(buf))}
|
||||
memset(&buf, 0, sizeof(buf))
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(_WIN32)
|
||||
|
@ -119,8 +118,7 @@ arc4_stir(struct arc4_stream *as)
|
|||
uint8_t rnd[128];
|
||||
int fd;
|
||||
fd = open("/dev/urandom", O_RDONLY);
|
||||
if(fd != -1)
|
||||
{
|
||||
if(fd != -1) {
|
||||
read(fd, rnd, sizeof(rnd));
|
||||
close(fd);
|
||||
arc4_addrandom(as, (void *)rnd, sizeof(rnd));
|
||||
|
@ -131,19 +129,16 @@ arc4_stir(struct arc4_stream *as)
|
|||
#else
|
||||
{
|
||||
LARGE_INTEGER performanceCount;
|
||||
if(QueryPerformanceCounter(&performanceCount))
|
||||
{
|
||||
if(QueryPerformanceCounter(&performanceCount)) {
|
||||
arc4_addrandom(as, (void *)&performanceCount, sizeof(performanceCount));
|
||||
}
|
||||
lib = LoadLibrary("ADVAPI32.DLL");
|
||||
if(lib)
|
||||
{
|
||||
if(lib) {
|
||||
uint8_t rnd[128];
|
||||
BOOLEAN(APIENTRY * pfn) (void *, ULONG) =
|
||||
(BOOLEAN(APIENTRY *) (void *, ULONG))GetProcAddress(lib,
|
||||
"SystemFunction036");
|
||||
if(pfn)
|
||||
{
|
||||
if(pfn) {
|
||||
if(pfn(rnd, sizeof(rnd)) == TRUE)
|
||||
arc4_addrandom(as, (void *)rnd, sizeof(rnd));
|
||||
memset(&rnd, 0, sizeof(rnd));
|
||||
|
@ -192,8 +187,7 @@ arc4_getword(struct arc4_stream *as)
|
|||
void
|
||||
arc4random_stir(void)
|
||||
{
|
||||
if(!rs_initialized)
|
||||
{
|
||||
if(!rs_initialized) {
|
||||
arc4_init(&rs);
|
||||
rs_initialized = 1;
|
||||
}
|
||||
|
|
|
@ -73,8 +73,7 @@
|
|||
static uintptr_t offset_pad;
|
||||
|
||||
/* status information for an allocated block in heap */
|
||||
struct rb_heap_block
|
||||
{
|
||||
struct rb_heap_block {
|
||||
size_t alloc_size;
|
||||
rb_dlink_node node;
|
||||
unsigned long free_count;
|
||||
|
@ -83,8 +82,7 @@ struct rb_heap_block
|
|||
typedef struct rb_heap_block rb_heap_block;
|
||||
|
||||
/* information for the root node of the heap */
|
||||
struct rb_bh
|
||||
{
|
||||
struct rb_bh {
|
||||
rb_dlink_node hlist;
|
||||
size_t elemSize; /* Size of each element to be stored */
|
||||
unsigned long elemsPerBlock; /* Number of elements per block */
|
||||
|
@ -152,8 +150,7 @@ rb_init_bh(void)
|
|||
* fix your shit
|
||||
*/
|
||||
#ifdef __sparc__
|
||||
if((offset_pad % __alignof__(long long)) != 0)
|
||||
{
|
||||
if((offset_pad % __alignof__(long long)) != 0) {
|
||||
offset_pad += __alignof__(long long);
|
||||
offset_pad &= ~(__alignof__(long long) - 1);
|
||||
}
|
||||
|
@ -207,8 +204,7 @@ static void
|
|||
rb_bh_gc_event(void *unused)
|
||||
{
|
||||
rb_dlink_node *ptr;
|
||||
RB_DLINK_FOREACH(ptr, heap_lists->head)
|
||||
{
|
||||
RB_DLINK_FOREACH(ptr, heap_lists->head) {
|
||||
rb_bh_gc(ptr->data);
|
||||
}
|
||||
}
|
||||
|
@ -237,14 +233,12 @@ newblock(rb_bh *bh)
|
|||
b->alloc_size = bh->elemsPerBlock * bh->elemSize;
|
||||
|
||||
b->elems = get_block(b->alloc_size);
|
||||
if(rb_unlikely(b->elems == NULL))
|
||||
{
|
||||
if(rb_unlikely(b->elems == NULL)) {
|
||||
return (1);
|
||||
}
|
||||
offset = (uintptr_t)b->elems;
|
||||
/* Setup our blocks now */
|
||||
for(i = 0; i < bh->elemsPerBlock; i++, offset += bh->elemSize)
|
||||
{
|
||||
for(i = 0; i < bh->elemsPerBlock; i++, offset += bh->elemSize) {
|
||||
*((void **)offset) = b;
|
||||
node = (void *)(offset + offset_pad);
|
||||
rb_dlinkAdd((void *)offset, node, &bh->free_list);
|
||||
|
@ -278,8 +272,7 @@ rb_bh_create(size_t elemsize, int elemsperblock, const char *desc)
|
|||
lrb_assert(elemsize >= sizeof(rb_dlink_node));
|
||||
|
||||
/* Catch idiotic requests up front */
|
||||
if((elemsize == 0) || (elemsperblock <= 0))
|
||||
{
|
||||
if((elemsize == 0) || (elemsperblock <= 0)) {
|
||||
rb_bh_fail("Attempting to rb_bh_create idiotic sizes");
|
||||
}
|
||||
|
||||
|
@ -290,8 +283,7 @@ rb_bh_create(size_t elemsize, int elemsperblock, const char *desc)
|
|||
bh = rb_malloc(sizeof(rb_bh));
|
||||
#ifndef NOBALLOC
|
||||
elemsize += offset_pad;
|
||||
if((elemsize % sizeof(void *)) != 0)
|
||||
{
|
||||
if((elemsize % sizeof(void *)) != 0) {
|
||||
/* Pad to even pointer boundary */
|
||||
elemsize += sizeof(void *);
|
||||
elemsize &= ~(sizeof(void *) - 1);
|
||||
|
@ -305,8 +297,7 @@ rb_bh_create(size_t elemsize, int elemsperblock, const char *desc)
|
|||
|
||||
#ifndef NOBALLOC
|
||||
/* Be sure our malloc was successful */
|
||||
if(newblock(bh))
|
||||
{
|
||||
if(newblock(bh)) {
|
||||
if(bh != NULL)
|
||||
free(bh);
|
||||
rb_lib_log("newblock() failed");
|
||||
|
@ -314,8 +305,7 @@ rb_bh_create(size_t elemsize, int elemsperblock, const char *desc)
|
|||
}
|
||||
#endif /* !NOBALLOC */
|
||||
|
||||
if(bh == NULL)
|
||||
{
|
||||
if(bh == NULL) {
|
||||
rb_bh_fail("bh == NULL when it shouldn't be");
|
||||
}
|
||||
rb_dlinkAdd(bh, &bh->hlist, heap_lists);
|
||||
|
@ -343,26 +333,22 @@ rb_bh_alloc(rb_bh *bh)
|
|||
void *ptr;
|
||||
#endif
|
||||
lrb_assert(bh != NULL);
|
||||
if(rb_unlikely(bh == NULL))
|
||||
{
|
||||
if(rb_unlikely(bh == NULL)) {
|
||||
rb_bh_fail("Cannot allocate if bh == NULL");
|
||||
}
|
||||
|
||||
#ifdef NOBALLOC
|
||||
return (rb_malloc(bh->elemSize));
|
||||
#else
|
||||
if(bh->free_list.head == NULL)
|
||||
{
|
||||
if(bh->free_list.head == NULL) {
|
||||
/* Allocate new block and assign */
|
||||
/* newblock returns 1 if unsuccessful, 0 if not */
|
||||
|
||||
if(rb_unlikely(newblock(bh)))
|
||||
{
|
||||
if(rb_unlikely(newblock(bh))) {
|
||||
rb_lib_log("newblock() failed");
|
||||
rb_outofmemory(); /* Well that didn't work either...bail */
|
||||
}
|
||||
if(bh->free_list.head == NULL)
|
||||
{
|
||||
if(bh->free_list.head == NULL) {
|
||||
rb_lib_log("out of memory after newblock()...");
|
||||
rb_outofmemory();
|
||||
}
|
||||
|
@ -400,14 +386,12 @@ rb_bh_free(rb_bh *bh, void *ptr)
|
|||
lrb_assert(bh != NULL);
|
||||
lrb_assert(ptr != NULL);
|
||||
|
||||
if(rb_unlikely(bh == NULL))
|
||||
{
|
||||
if(rb_unlikely(bh == NULL)) {
|
||||
rb_lib_log("balloc.c:rb_bhFree() bh == NULL");
|
||||
return (1);
|
||||
}
|
||||
|
||||
if(rb_unlikely(ptr == NULL))
|
||||
{
|
||||
if(rb_unlikely(ptr == NULL)) {
|
||||
rb_lib_log("balloc.rb_bhFree() ptr == NULL");
|
||||
return (1);
|
||||
}
|
||||
|
@ -420,8 +404,7 @@ rb_bh_free(rb_bh *bh, void *ptr)
|
|||
/* XXX */
|
||||
if(rb_unlikely
|
||||
(!((uintptr_t)ptr >= (uintptr_t)block->elems
|
||||
&& (uintptr_t)ptr < (uintptr_t)block->elems + (uintptr_t)block->alloc_size)))
|
||||
{
|
||||
&& (uintptr_t)ptr < (uintptr_t)block->elems + (uintptr_t)block->alloc_size))) {
|
||||
rb_bh_fail("rb_bh_free() bogus pointer");
|
||||
}
|
||||
block->free_count++;
|
||||
|
@ -453,8 +436,7 @@ rb_bh_destroy(rb_bh *bh)
|
|||
return (1);
|
||||
|
||||
#ifndef NOBALLOC
|
||||
RB_DLINK_FOREACH_SAFE(ptr, next, bh->block_list.head)
|
||||
{
|
||||
RB_DLINK_FOREACH_SAFE(ptr, next, bh->block_list.head) {
|
||||
b = ptr->data;
|
||||
free_block(b->elems, b->alloc_size);
|
||||
rb_free(b);
|
||||
|
@ -474,8 +456,7 @@ rb_bh_usage(rb_bh *bh, size_t *bused, size_t *bfree, size_t *bmemusage, const ch
|
|||
#ifndef NOBALLOC
|
||||
size_t used, freem, memusage;
|
||||
|
||||
if(bh == NULL)
|
||||
{
|
||||
if(bh == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -514,8 +495,7 @@ rb_bh_usage_all(rb_bh_usage_cb *cb, void *data)
|
|||
if(cb == NULL)
|
||||
return;
|
||||
|
||||
RB_DLINK_FOREACH(ptr, heap_lists->head)
|
||||
{
|
||||
RB_DLINK_FOREACH(ptr, heap_lists->head) {
|
||||
bh = (rb_bh *)ptr->data;
|
||||
freem = rb_dlink_list_length(&bh->free_list);
|
||||
used = (rb_dlink_list_length(&bh->block_list) * bh->elemsPerBlock) - freem;
|
||||
|
@ -535,8 +515,7 @@ rb_bh_total_usage(size_t *total_alloc, size_t *total_used)
|
|||
size_t total_memory = 0, used_memory = 0, used, freem;
|
||||
rb_bh *bh;
|
||||
|
||||
RB_DLINK_FOREACH(ptr, heap_lists->head)
|
||||
{
|
||||
RB_DLINK_FOREACH(ptr, heap_lists->head) {
|
||||
bh = (rb_bh *)ptr->data;
|
||||
freem = rb_dlink_list_length(&bh->free_list);
|
||||
used = (rb_dlink_list_length(&bh->block_list) * bh->elemsPerBlock) - freem;
|
||||
|
@ -559,32 +538,27 @@ rb_bh_gc(rb_bh *bh)
|
|||
unsigned long i;
|
||||
uintptr_t offset;
|
||||
|
||||
if(bh == NULL)
|
||||
{
|
||||
if(bh == NULL) {
|
||||
/* somebody is smoking some craq..(probably lee, but don't tell him that) */
|
||||
return (1);
|
||||
}
|
||||
|
||||
if((rb_dlink_list_length(&bh->free_list) < bh->elemsPerBlock)
|
||||
|| rb_dlink_list_length(&bh->block_list) == 1)
|
||||
{
|
||||
|| rb_dlink_list_length(&bh->block_list) == 1) {
|
||||
/* There couldn't possibly be an entire free block. Return. */
|
||||
return (0);
|
||||
}
|
||||
|
||||
RB_DLINK_FOREACH_SAFE(ptr, next, bh->block_list.head)
|
||||
{
|
||||
RB_DLINK_FOREACH_SAFE(ptr, next, bh->block_list.head) {
|
||||
b = ptr->data;
|
||||
if(rb_dlink_list_length(&bh->block_list) == 1)
|
||||
return (0);
|
||||
|
||||
if(b->free_count == bh->elemsPerBlock)
|
||||
{
|
||||
if(b->free_count == bh->elemsPerBlock) {
|
||||
/* i'm seriously going to hell for this.. */
|
||||
|
||||
offset = (uintptr_t)b->elems;
|
||||
for(i = 0; i < bh->elemsPerBlock; i++, offset += (uintptr_t)bh->elemSize)
|
||||
{
|
||||
for(i = 0; i < bh->elemsPerBlock; i++, offset += (uintptr_t)bh->elemSize) {
|
||||
rb_dlinkDelete((rb_dlink_node *)(offset + offset_pad),
|
||||
&bh->free_list);
|
||||
}
|
||||
|
|
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
Loading…
Reference in New Issue