Commit Graph

143 Commits

Author SHA1 Message Date
Kevin Easton
6691732900 Make add_socketread() close the new socket if it can't be added to the
socket manager because it exceeds FD_SETSIZE.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@307 13b04d17-f746-0410-82c6-800466cd88b0
2013-08-07 23:03:45 +00:00
Tim Cava
d68a196b8a Mention fixes to commands in the banlist.c cleanup.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@297 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-31 05:40:44 +00:00
Kevin Easton
9378704c39 Improve the list_channels() function so that it behaves correctly when
connected to multiple servers.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@285 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-14 14:01:20 +00:00
Kevin Easton
7d9ffbe792 Add Changelog entry for socklen_t change.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@284 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-14 13:33:09 +00:00
Kevin Easton
2235c029bb Update Changelog for sys/termios -> termios fix.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@276 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-14 02:03:44 +00:00
Tim Cava
ee761e7f02 Skip malformed entries in abots.sav, which avoids two null dereferences found by Coverity.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@250 13b04d17-f746-0410-82c6-800466cd88b0
2013-06-28 05:22:20 +00:00
Kevin Easton
8a04cbeba8 Don't pass the output of convert_output_format(FORMAT_DCC, ...) directly to
sprintf() as a format string, because there could (and usually are!) '%'
characters that will be interpreted by sprintf.

This also allows clean compilation under -Werror=format-security.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@246 13b04d17-f746-0410-82c6-800466cd88b0
2013-06-23 14:36:32 +00:00
Kevin Easton
c51810738e Improve handling of one kind of malformed CDCC save file, where the pack
description line doesn't contain a space.  Found by Coverity.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@244 13b04d17-f746-0410-82c6-800466cd88b0
2013-06-20 01:45:29 +00:00
Kevin Easton
882c3150e2 Fix open file leak in /LASTLOG, in situations like:
/LASTLOG -FILE /tmp/a -FILE /tmp/a
/LASTLOG -FILE /tmp/a -CLEAR
/LASTLOG -FILE /tmp/a -LITERAL
/LASTLOG -FILE /tmp/a -BOGUS

Found by Coverity.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@243 13b04d17-f746-0410-82c6-800466cd88b0
2013-06-18 12:55:32 +00:00
Kevin Easton
2fc84d5f93 Fix a file descriptor leak when connect() fails during a SOCKS4 proxy
connection attempt.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@242 13b04d17-f746-0410-82c6-800466cd88b0
2013-06-18 11:00:12 +00:00
Tim Cava
df8328c3a1 Fix out-of-bounds error in cryptit() found by Coverity.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@240 13b04d17-f746-0410-82c6-800466cd88b0
2013-06-16 14:40:52 +00:00
Kevin Easton
ceb0492734 Cleanup save_formats() by removing unused function argument.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@238 13b04d17-f746-0410-82c6-800466cd88b0
2013-06-16 12:21:03 +00:00
Kevin Easton
bad477f9dc Fix off-by-one error in the check for s against FD_SETSIZE in add_socketread()
and set_socketwrite().  This was found by Coverity.



git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@237 13b04d17-f746-0410-82c6-800466cd88b0
2013-06-16 06:04:29 +00:00
Kevin Easton
092d9789e0 Order the rfc1459[] array correctly.
This is a longstanding bug - it's also present in EPIC4 and EPIC5 so it's
probably been in BitchX since the beginning.  The bug has been latent until
the AUTHENTICATE and CAP commands were added, which perturbed the binary
search so that the client didn't see invite messages properly.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@235 13b04d17-f746-0410-82c6-800466cd88b0
2013-04-24 12:05:44 +00:00
Kevin Easton
73269ea887 Bail out of check_auto_reply() early if auto_str is NULL. This fixes a
crash after /SETAR -.

Reported by riderplus.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@234 13b04d17-f746-0410-82c6-800466cd88b0
2013-03-01 12:33:00 +00:00
Kevin Easton
17e3a91f03 Remove handling for the 484 numeric. It was intended for ircnet's 484
(ERR_RESTRICTED), to set user mode +r - however this does not appear to
be necessary anymore.  It was also buggy for several reasons: due to 
a change in set_server_flag() this has actually been setting mode +G; and
484 is ERR_ISCHANSERVICE on other ircds.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@233 13b04d17-f746-0410-82c6-800466cd88b0
2013-02-25 12:22:54 +00:00
Kevin Easton
e99861dbfb Add /OBITS command showing obituaries for long-time BitchX friends.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@230 13b04d17-f746-0410-82c6-800466cd88b0
2013-02-21 22:29:34 +00:00
Kevin Easton
1390402af1 Fix abuses of the RESIZE() macro in array.c, of the form:
x = RESIZE(x, type, size);

which should just be:

RESIZE(x, type, size);

The erroneous use is undefined behaviour according to the C standard, and
causes new versions of gcc (and, apparently, clang) to throw a warning.

Reported by nenolod/moogle.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@227 13b04d17-f746-0410-82c6-800466cd88b0
2013-02-16 08:11:07 +00:00
Kevin Easton
a1ec2113e9 Fix sort_scores in the acro plugin - pass the correct number of array entries
to qsort() and properly reconstruct the list.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@224 13b04d17-f746-0410-82c6-800466cd88b0
2013-01-04 10:11:32 +00:00
Kevin Easton
f51de3a170 Fix the timer callbacks in the acro plugin to use the correct function
signature.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@223 13b04d17-f746-0410-82c6-800466cd88b0
2013-01-04 09:03:12 +00:00
Kevin Easton
bf40ef7015 Use INSTALL_DATA instead of INSTALL to install the BitchX.hints file. This
means it's not made executable.

Patch from Jeff Horelick <jdhore@gentoo.org>.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@222 13b04d17-f746-0410-82c6-800466cd88b0
2013-01-03 03:03:30 +00:00
Kevin Easton
2027f75969 Move inclusion of system headers in misc.c to top, which fixes building on
recent Cygwin (including windows.h after the macros defined in modval.h
causes the build to fail due to our 'load' macro).  Reported by VICODAN.

Also define WIN32_LEAN_AND_MEAN in misc.c, which should speed up Cygwin
build times a little.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@219 13b04d17-f746-0410-82c6-800466cd88b0
2013-01-02 22:40:58 +00:00
Kevin Easton
b2c9da8fef Fix the AC_CHECK_PLUGIN_SUPPORT configure macro so that it matches FreeBSD-1.*
instead of FreeBSD-1*, which fixes building with plugins on FreeBSD-10.  Also
a similar fix for the FreeBSD-2.* case.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@217 13b04d17-f746-0410-82c6-800466cd88b0
2012-12-30 22:47:03 +00:00
Tim Cava
0d67cac5f7 Add a note about fixing QUITs with SSL connections.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@215 13b04d17-f746-0410-82c6-800466cd88b0
2012-10-21 01:36:23 +00:00
Kevin Easton
1e7c7edd1b Use LOG_PUBLIC instead of LOG_MSG for PRIVMSGs sent to channels.
This doesn't tend to affect what window they go to, since for channels
there's always a target window based on the channel.  But it does
affect logging.

This was fixed in EPIC4 back in 2001.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@214 13b04d17-f746-0410-82c6-800466cd88b0
2012-10-19 12:25:25 +00:00
Kevin Easton
f7607baf45 Add tcl.c to source distribution (panasync gave his permission for this to be released).
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@213 13b04d17-f746-0410-82c6-800466cd88b0
2012-10-19 12:11:05 +00:00
Kevin Easton
3ed7f68d4e Rename include/bitchx to include/options.h. This fixes building on
case-insensitive filesystems like NTFS or HFS+, where it clashes with
the BitchX binary.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@204 13b04d17-f746-0410-82c6-800466cd88b0
2012-06-02 14:53:37 +00:00
Kevin Easton
252d1bf004 On systems that support it, supply the AI_ADDRCONFIG flag to getaddrinfo().
This means that we shouldn't try to connect using IPv6 if the local machine
doesn't have an IPv6 address itself.

This also simplifies the IPv6 code in BX_connect_by_number() a bit.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@203 13b04d17-f746-0410-82c6-800466cd88b0
2012-06-02 11:38:37 +00:00
Kevin Easton
fa42be30ae Change configure.in to enable SSL by default, if libssl is present. Can
still be disabled with --without-ssl.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@201 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-31 12:40:26 +00:00
Kevin Easton
ba365bfd54 Fix logic error that can result in a potential crash (when getaddrinfo() fails
and res happened to be NULL).

Also add missing freeaddrinfo() call.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@188 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-15 13:29:32 +00:00
Kevin Easton
9ec4f49540 Apply patch from snadge to set BIND_4_COMPAT on OpenBSD. This is similar
to the existing BIND_8_COMPAT fix for OSX.

Oh how I hate the /nslookup function.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@187 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-15 13:16:11 +00:00
Kevin Easton
f035eceb72 Pass the right socket address length to bind() in client connections with
IPv6 enabled.  This fixes an issue reported by packet, where IPv4 conections
don't work on FreeBSD when the client is built with IPv6 support and you
have a local hostname set (with /hostname, -H or IRCHOST).

Also ensure we clear the full size of the 'server' address structure - doesn't
fix a known problem but is a defensive measure.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@181 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-13 14:06:53 +00:00
Kevin Easton
0271799a4a Remove check for Linux from IPv6 tests. Replace GLIBC version test with
a generic link test for "native" IPv6.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@177 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-11 12:31:31 +00:00
Kevin Easton
0219904860 Ensure that real errors from connect() (eg. EINVAL) are detected and
acted on immmediately, even for nonblocking connects.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@175 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-11 12:03:10 +00:00
Kevin Easton
eb964e1c52 Remove BitchX.spec and gtkBitchX.spec - these are obsolete now. A new
BitchX.spec will be added later.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@170 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-10 12:22:22 +00:00
Kevin Easton
822522affa Fix test so that sig.inc isn't built if sys_siglist, _sys_siglist or strsignal
is available.

In the long-run sig.inc should be built by a Makefile target.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@169 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-10 09:16:25 +00:00
Kevin Easton
5d1953946e Use the correct dependencies when checking for net/if.h, arpa/inet.h and resolv.h
(fixes a nasty configure spew on FreeBSD, reported by flashback).

Add check for sys/socket.h, replace unused checks for netinet/in_systm.h and 
sys/in_system.h with a check for netinet/in.h.  Remove unused check for
sys/syslimits.h.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@168 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-10 09:12:27 +00:00
Kevin Easton
3bbe082f16 Fix aim and nap plugin Makefiles so that they build compat.o in the right
place when building out-of-tree.  Reported by nyet.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@166 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-08 15:20:39 +00:00
Kevin Easton
7ee26d4ed3 Change the install* targets in the Makefiles to honour DESTDIR. This
makes packaging the client for .deb and .rpm easier.

Reported separately by nyet and VICODAN.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@164 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-08 14:34:25 +00:00
Kevin Easton
3090365354 Change connect_by_number() so that SERVICE_SERVER sockets are always bound to
IPv4 even on an IPv6-enabled client.  This fixes /detach and wserv when
compiling with --enable-ipv6.

This does also mean that the internal identd, if used, won't listen on IPv6
either.  This isn't a problem yet, since the internal identd is used only on
WINNT and we don't support IPv6 there yet.

This will also need tweaking to support initiating DCC-over-IPv6.

Thanks to snadge and packet for working on this bug.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@162 13b04d17-f746-0410-82c6-800466cd88b0
2012-04-29 12:15:57 +00:00
Kevin Easton
10d5ab5a18 Changelog update for r160 change.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@161 13b04d17-f746-0410-82c6-800466cd88b0
2012-03-06 12:12:58 +00:00
Kevin Easton
6c6ae94dd4 Changelog update for rev 150 change.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@151 13b04d17-f746-0410-82c6-800466cd88b0
2012-02-16 09:10:06 +00:00
Kevin Easton
122849f247 Replace _getshort() and _getlong() with NS_GET16() and NS_GET32() respectively.
Fixes compilation on cygwin (and possibly other targets).


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@148 13b04d17-f746-0410-82c6-800466cd88b0
2012-02-08 12:53:16 +00:00
Kevin Easton
7978a87c9f Change async DNS resolver code to register its file descriptor with the IO
core.  This fixes /nslookup.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@147 13b04d17-f746-0410-82c6-800466cd88b0
2012-02-08 11:24:48 +00:00
Kevin Easton
ed16081a2b Remove bogus F_SETOWN use in /detach code.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@146 13b04d17-f746-0410-82c6-800466cd88b0
2012-02-01 13:26:50 +00:00
Kevin Easton
71cc2bf5f4 Add FORMAT_WHOIS_SECURE for SSL connection info from ratbox, unreal and freenode servers (RPL_WHOISSECURE). Does not support
hybrid yet because it uses numeric 275, which clashes with unreal's RPL_STATSDLINE.

RIP dmr.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@144 13b04d17-f746-0410-82c6-800466cd88b0
2011-10-13 12:45:27 +00:00
Kevin Easton
b355145d69 Add /FSET CHANNEL_URL to format the RPL_CHANNELURL (328) numeric sent by dalnet and atheme services.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@142 13b04d17-f746-0410-82c6-800466cd88b0
2011-10-04 12:47:01 +00:00
Kevin Easton
206df688ba Fix mircansi() so that it properly handles non-numeric characters
after a comma.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@140 13b04d17-f746-0410-82c6-800466cd88b0
2011-09-07 12:48:35 +00:00
Kevin Easton
02e4ced684 Add PC_TOPIC flag to prepare_command() for topic-change commands.
Clean up e_topic(), splitting out untopic() and using prepare_command()
to check for ops.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@136 13b04d17-f746-0410-82c6-800466cd88b0
2011-09-05 12:57:31 +00:00
Kevin Easton
b628217600 Fix a memory leak in the URL grabber - as old URLs were expired from the list,
they weren't being freed.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@131 13b04d17-f746-0410-82c6-800466cd88b0
2011-05-17 14:03:29 +00:00