Commit Graph

212 Commits

Author SHA1 Message Date
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
Kevin Easton
47ce4ab1e1 Apply changes to BitchX.help from t3gah.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@124 13b04d17-f746-0410-82c6-800466cd88b0
2011-04-18 12:38:21 +00:00
Kevin Easton
09c34c045f Further cleanups and fixes in chelp.c:read_file(). Now properly adds NULLs to
terminate the lists, that the code in get_help_topic() expects to be there - 
fixes a potential crash in /bhelp.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@123 13b04d17-f746-0410-82c6-800466cd88b0
2011-04-17 11:58:16 +00:00
Kevin Easton
780ac2c149 Cleanup and rename replace_color() to put_color(), including sanity-checking of
foreground color code - this ensures that if a wild color code makes it this
far, it doesn't crash the client.



git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@121 13b04d17-f746-0410-82c6-800466cd88b0
2011-04-08 13:10:05 +00:00
Kevin Easton
c45c6a69bf Cleanup p_mode() and correct handling of user mode changes where the source
and the target aren't the same (reported by gauze).  This doesn't happen
on standard servers, but is used by services on some networks.

Adds /FSET USERMODE_OTHER.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@114 13b04d17-f746-0410-82c6-800466cd88b0
2011-03-31 22:20:21 +00:00
Kevin Easton
719279790e Add some more TLDs to $country(), synchronised with the IANA list: .ax, .eu,
.me, .rs, .tl, .asia, .cat, .jobs, .tel and .travel.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@113 13b04d17-f746-0410-82c6-800466cd88b0
2011-03-31 08:32:23 +00:00
Kevin Easton
b17b09949b Improve country() by using "static const" for lookup table (makes function 25% smaller)
and const-correctness.  Add .mobi TLD.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@112 13b04d17-f746-0410-82c6-800466cd88b0
2011-03-23 11:17:23 +00:00
Kevin Easton
94550b1fac Changelog update - Irix fixes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@111 13b04d17-f746-0410-82c6-800466cd88b0
2011-02-02 12:41:50 +00:00
Kevin Easton
6711ef7f00 Correct use of IN6ADDR_ANY_INIT initialiser, fixes IPv6 build on Intel ICC.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@105 13b04d17-f746-0410-82c6-800466cd88b0
2010-12-16 21:15:15 +00:00
Kevin Easton
d1e13bc526 Show correct message ("Remote end closed connection") when we get EOF
on a socket.

I also added a wrapper function around strerror() for dgets_errno, since
we did the same thing in a few places.  This all needs to be cleaned up
a little - the -1 value we use could in theory clash with an actual
errno error number.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@104 13b04d17-f746-0410-82c6-800466cd88b0
2010-09-30 13:26:06 +00:00
Kevin Easton
7a59da1f2e Add /FSET WHOIS_CALLERID for +g mode notification on hybrid & ratbox.
This is numeric 716.  Hybrid shows it in WHOIS, and both show it when you
try to PRIVMSG someone who is +g (similar to AWAY).  So I've formatted it
to match the WHOIS block.

I also took the chance to fix up the ordering of the fsets, and remove
a bunch of redundant setting of default values.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@103 13b04d17-f746-0410-82c6-800466cd88b0
2010-09-30 12:48:28 +00:00
Kevin Easton
5430be4c78 Add RPL_WHOISHOST (378) numeric from Unreal (and freenode).
Formats with /fset WHOIS_ACTUALLY.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@102 13b04d17-f746-0410-82c6-800466cd88b0
2010-09-20 12:30:55 +00:00
Kevin Easton
2f92982eac Build script fix to allow plugins to build on x86-64.
$(SHLIB_CFLAGS) is required on the compile line, not just the link line.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@99 13b04d17-f746-0410-82c6-800466cd88b0
2010-09-09 01:08:14 +00:00
Kevin Easton
f71e26acc7 Correct count in /CLONES (reported by t3gah), and format output nicely
using an /fset.

/CLONES now uses the same formats as the /U command.  Also tweaked those
formats at the same time.



git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@98 13b04d17-f746-0410-82c6-800466cd88b0
2010-09-06 13:40:13 +00:00
Kevin Easton
cb8e8c21ae Add definition of BIND_8_COMPAT to fix build problem on Mac OS X.
Every other UNIX in existence defines BIND_4_COMPAT in arpa/nameser.h, which
ensures that nameser_compat.h gets included.  Mac OS X changed it to 
BIND_8_COMPAT and stopped including it by default.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@97 13b04d17-f746-0410-82c6-800466cd88b0
2010-09-06 12:46:03 +00:00
Kevin Easton
518186b85b Add changelog message for -z command line option fix.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@96 13b04d17-f746-0410-82c6-800466cd88b0
2010-09-05 09:21:16 +00:00
Kevin Easton
3c0e23a7c5 Ensure that SHOW_AWAY_ONCE doesn't hide away status in /whois output, by
clearing last_away_msg when the 311 whois reply numeric is recieved.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@95 13b04d17-f746-0410-82c6-800466cd88b0
2010-09-05 09:03:32 +00:00
Kevin Easton
0fe403c70c Fix attribution.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@89 13b04d17-f746-0410-82c6-800466cd88b0
2010-06-27 00:50:35 +00:00
Kevin Easton
223926fdf2 Fix up /WILN, /WILC and /WILCR. last_ctcp is now the last CTCP request
recieved; last_ctcp_reply is the last reply recieved (used by /RELCR etc.)

All of the /WI* commands now do a /WII style full whois request.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@88 13b04d17-f746-0410-82c6-800466cd88b0
2010-06-26 14:43:22 +00:00
Kevin Easton
789ed916cd Backport changes from epic5 to make recv_nick, sent_nick and sent_body
per-server, and apply new version of do_oops from flewid (the BX2 version). 

This means that /oops, "/query .", "/query ,", "/msg ." and "/msg ," are now
per-server, along with the $. $, and $B aliases.



git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@87 13b04d17-f746-0410-82c6-800466cd88b0
2010-06-26 08:18:34 +00:00
Kevin Easton
1a0e5ec166 The /cd command now handles getcwd() failing (eg if the current directory
has been removed).


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@85 13b04d17-f746-0410-82c6-800466cd88b0
2010-05-02 08:18:29 +00:00
Kevin Easton
8c099a4ce3 Fix alloca build warnings on freebsd (backport from epic).
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@83 13b04d17-f746-0410-82c6-800466cd88b0
2010-03-07 07:24:12 +00:00
Kevin Easton
f8c9021184 Fix minor memory leak in banlist.c:delay_flush_all.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@79 13b04d17-f746-0410-82c6-800466cd88b0
2009-11-18 10:30:46 +00:00
Kevin Easton
db57885dfb Fix the definition of AC_CHECK_PLUGIN_SUPPORT in aclocal.m4, which was
making configure break on FreeBSD 9 (reported FreeBSD bitchx port maintainer
cpet <chris@officialunix.com>).



git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@78 13b04d17-f746-0410-82c6-800466cd88b0
2009-11-18 10:13:19 +00:00
Kevin Easton
b2a282feaa Fix a refcounting issue in the whowas list handling.
When a user in one of the whowas lists rejoins, their entry is removed from
the whowas list (and added to a channel nicklist).  However the count of
entries in the whowas list wasn't being decremented, so eventually the client
thinks the lists are full when they're really empty... at this point only one
user at a time can be in the lists (so /WHOLEFT after a netsplit would only
show one user).



git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@77 13b04d17-f746-0410-82c6-800466cd88b0
2009-10-16 12:35:56 +00:00
Kevin Easton
cb306c8947 Changelog entry for /hostname fix.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@76 13b04d17-f746-0410-82c6-800466cd88b0
2009-09-27 12:48:25 +00:00
Kevin Easton
5337b226fa Change the handle_server_stats so that the averages (eg. users per
channel) are correctly rounded. Added a divide_rounded() function
that rounds to nearest integer.  This also gets rid of the messy
floating point divisions in that function.



git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@73 13b04d17-f746-0410-82c6-800466cd88b0
2009-09-22 22:35:23 +00:00
Kevin Easton
0fc23ba148 Reinstate a new version of RPL_WHOISACTUALLY numeric handling.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@72 13b04d17-f746-0410-82c6-800466cd88b0
2009-09-21 14:14:28 +00:00
Kevin Easton
771b2af59d Fixed two places where the client compared the source of a numeric against
get_server_name(from_server) instead of get_server_itsname(from_server) -
this meant that if the client had a different idea of the local server name
from the server (say, if you used a round-robin to connect), then the client
would incorrectly assume the numeric came from a remote server.

The symptoms were:

 * If your local server sent you a "you're not op" type message, BitchX would
report the channel had desynched.

 * If your local server send you a "channel doesn't exist" numeric (eg. if
you typed /mode #nosuchchannel to see if it existed), BitchX would not show
it. 


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@71 13b04d17-f746-0410-82c6-800466cd88b0
2009-09-19 14:24:15 +00:00
Kevin Easton
e338d2d9fd Fix the $servernum() function - no matter what string
you gave it, it would return the first server in the list
where server.itsname == server.name, due to a misplaced
variable.  It also returned an empty string for
$servernum(  ) when it should return the current server.

Also removed the useless function_serverport() function -
it was a character-for-character duplicate of
function_servports().


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@70 13b04d17-f746-0410-82c6-800466cd88b0
2009-09-17 13:38:09 +00:00
Kevin Easton
ef503e318e Fix .cmsg crash reported by zimzum.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@62 13b04d17-f746-0410-82c6-800466cd88b0
2009-09-02 14:14:21 +00:00
Kevin Easton
1b370475ec Fixed the defaults for JOIN_NEW_WINDOW_TYPE and QUERY_NEW_WINDOW_TYPE.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@59 13b04d17-f746-0410-82c6-800466cd88b0
2009-08-11 14:08:53 +00:00