Commit Graph

160 Commits

Author SHA1 Message Date
Tim Cava
4309055cf7 Including dcc.h in commands2.c is unnecessary.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@291 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-15 06:02:23 +00:00
Tim Cava
6ae6edc0fb Make the definition of Tgetstr() use the value of y, when terminfo is
available, which quiets an unused variable warning.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@289 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-15 04:13:52 +00:00
Tim Cava
2d80cbb680 Restore this variable, as it's used when terminfo isn't available.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@288 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-15 03:48:43 +00:00
Tim Cava
3b509dfa52 Kill an unused variable in term_init().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@287 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-15 03:17:49 +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
e915462aef Change a & to && in BX_do_compress_modes() to squash a warning. Should
be no behavioural change.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@283 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-14 13:25:22 +00:00
Tim Cava
0450875ab5 Remove two unnecessary includes from alias.c.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@282 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-14 05:26:51 +00:00
Tim Cava
37dcaad1ae Make the addrlen passed to connect() in connect_by_number() a socklen_t.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@281 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-14 04:16:13 +00:00
Tim Cava
e070369079 Make the namelen passed to getsockname() a socklen_t everywhere.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@280 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-14 03:26:00 +00:00
Tim Cava
80cfa9c5d8 Make the namelen passed to getpeername() a socklen_t everywhere.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@279 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-14 03:18:47 +00:00
Tim Cava
27ed98a03d Make the addrlen passed to my_accept() a socklen_t everywhere.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@278 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-14 03:09:16 +00:00
Tim Cava
a3b938dfd5 Make the addrlen argument to my_accept() a socklen_t.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@277 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-14 02:59:11 +00:00
Kevin Easton
cc0b75f2dd Include <termios.h> in preference to <sys/termios.h>.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@275 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-14 02:01:59 +00:00
Kevin Easton
791c49986e Remove unnecessary termios.h includes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@272 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-14 00:51:58 +00:00
Tim Cava
b4cd944bef The third argument to accept() should be a socklen_t.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@269 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-13 22:21:32 +00:00
Tim Cava
4ff0b8d2d5 Make sure setupterm() returns ERR before examining the status value.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@252 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-01 01:23:18 +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
dd9de3dff0 Update (currently un-used) save_digraphs() function so that it compiles
cleanly with -Werror=format-security.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@245 13b04d17-f746-0410-82c6-800466cd88b0
2013-06-23 14:32:47 +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
b26e295137 Improve cryptit() fixes, suggested by caf.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@241 13b04d17-f746-0410-82c6-800466cd88b0
2013-06-17 08:00:37 +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
88172a9004 paused_topic should be the same size as help_topic_list.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@239 13b04d17-f746-0410-82c6-800466cd88b0
2013-06-16 13:12:59 +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
Tim Cava
d7a0c781f8 Convert simple uses of alloca/strcpy to LOCAL_COPY.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@232 13b04d17-f746-0410-82c6-800466cd88b0
2013-02-24 07:32:59 +00:00
Tim Cava
a7c93a3950 Remove a redundant call to alloca.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@231 13b04d17-f746-0410-82c6-800466cd88b0
2013-02-23 20:57:24 +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
5da6c807c2 Remove old reference to BitchX.com
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@229 13b04d17-f746-0410-82c6-800466cd88b0
2013-02-21 11:04:35 +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
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
1541299fa1 Merge infrastructure for SASL authentication support from flashback.
This includes all of the underlying support, but doesn't hook it up to the
/SERVER command yet, so it's not useable at this point.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@216 13b04d17-f746-0410-82c6-800466cd88b0
2012-12-30 02:22:56 +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
Tim Cava
416fcda578 Fix QUIT messages with SSL connections.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@212 13b04d17-f746-0410-82c6-800466cd88b0
2012-09-20 02:36:48 +00:00
Kevin Easton
69fd6e12c7 Change command used to install help files so that it ignores VCS directories.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@208 13b04d17-f746-0410-82c6-800466cd88b0
2012-06-17 23:22:55 +00:00
Kevin Easton
d22a4531d8 Update old email addresses in user-visible messages.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@206 13b04d17-f746-0410-82c6-800466cd88b0
2012-06-13 12:34:32 +00:00
Tim Cava
46cf14c0da Fix the MKNU command, with suggestions from caf.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@205 13b04d17-f746-0410-82c6-800466cd88b0
2012-06-07 04:22:17 +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
d13eee6683 The Cygwin resolver library doesn't fill out the list of name servers in
res_init() if /etc/resolv.conf doesn't exist, which is usual.

Add code to handle this by calling GetNetworkParams().


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@198 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-28 13:52:18 +00:00
Kevin Easton
79625bf516 Define BIND_4_COMPAT everywhere (except OS X, who just _had_ to be different)
and switch to using BIND4 macros (GETSHORT / GETLONG).

Should fix /nslookup on OpenBSD.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@196 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-27 04:42:09 +00:00
Kevin Easton
ab7d59f1f6 Add a length sanity check - just in case there's an implementation out there
that parses AF_UNIX addresses in getaddrinfo() or something.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@189 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-15 14:01:42 +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
26a62fe7fa Rework the IPV6 verison of BX_ip_to_host() so that it works on BSD (used
by $iptoname() scripting function).


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@182 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-14 13:56:52 +00:00