diff options
| author | Jelmer Vernooij <jelmer@samba.org> | 2005-12-04 22:55:15 +0100 | 
|---|---|---|
| committer | Jelmer Vernooij <jelmer@samba.org> | 2005-12-04 22:55:15 +0100 | 
| commit | 019c031a8d77fa8f21792ccf0e07c2dfa058ce5f (patch) | |
| tree | 116b7dc98dc8b4d4805a02f7e5d4ce64c95b9eac | |
| parent | 500a1b60d3dd0565d215721e0db7ec7da2dec2e0 (diff) | |
| parent | d636233a518fbe46264230866d4b8ea463f1474e (diff) | |
Merge from Wilmer
| -rw-r--r-- | bitlbee.c | 10 | ||||
| -rw-r--r-- | bitlbee.h | 2 | ||||
| -rwxr-xr-x | configure | 26 | ||||
| -rw-r--r-- | doc/AUTHORS | 2 | ||||
| -rw-r--r-- | doc/CHANGES | 22 | ||||
| -rw-r--r-- | doc/FAQ | 26 | ||||
| -rw-r--r-- | doc/README | 17 | ||||
| -rw-r--r-- | doc/TODO | 40 | ||||
| -rw-r--r-- | doc/user-guide/user-guide.xml | 19 | ||||
| -rw-r--r-- | irc.c | 2 | ||||
| -rw-r--r-- | protocols/jabber/jabber.c | 21 | ||||
| -rw-r--r-- | protocols/nogaim.c | 13 | ||||
| -rw-r--r-- | protocols/proxy.c | 4 | ||||
| -rw-r--r-- | protocols/yahoo/crypt.c | 4 | ||||
| -rw-r--r-- | protocols/yahoo/libyahoo2.c | 4 | ||||
| -rw-r--r-- | protocols/yahoo/yahoo_httplib.c | 4 | ||||
| -rw-r--r-- | protocols/yahoo/yahoo_util.c | 4 | 
17 files changed, 90 insertions, 130 deletions
| @@ -164,7 +164,15 @@ gboolean bitlbee_io_current_client_read( GIOChannel *source, GIOCondition condit  		irc_free( irc );  		return FALSE;  	}  -		 +	 +	/* Very naughty, go read the RFCs! >:) */ +	if( irc->readbuffer && ( strlen( irc->readbuffer ) > 1024 ) ) +	{ +		log_message( LOGLVL_ERROR, "Maximum line length exceeded." ); +		irc_free( irc ); +		return FALSE; +	} +	  	return TRUE;  } @@ -29,7 +29,7 @@  #define _GNU_SOURCE /* Stupid GNU :-P */  #define PACKAGE "BitlBee" -#define BITLBEE_VERSION "1.0pre" +#define BITLBEE_VERSION "1.0"  #define VERSION BITLBEE_VERSION  #define MAX_STRING 128 @@ -56,7 +56,6 @@ Option		Description				Default  --debug=0/1	Disable/enable debugging		$debug  --strip=0/1	Disable/enable binary stripping		$strip ---flood=0/1	Flood protection			$flood  --ipv6=0/1	IPv6 socket support			$ipv6  --ssl=...	SSL library to use (gnutls, nss, openssl, bogus, auto) @@ -286,7 +285,11 @@ else  fi  if [ "$flood" = 1 ]; then -	echo '#define FLOOD_SEND' >> config.h +	# echo '#define FLOOD_SEND' >> config.h +	echo 'Flood protection is disabled in this release because of too many bugs.' 2> /dev/stderr +	rm config.h +	rm Makefile.settings +	exit 1  fi  if [ -n "$BITLBEE_VERSION" ]; then @@ -344,33 +347,28 @@ echo  echo Architecture: $arch  case "$arch" in  Linux ) -	echo 'Linux.'  ;;  GNU/* ) -	echo 'Debian with non-Linux kernel?'  ;;  *BSD ) -	echo '*BSD.'  	echo 'EFLAGS+=-liconv' >> Makefile.settings;  ;;  SunOS ) -	echo 'Solaris.'  	echo 'EFLAGS+=-lresolv -lnsl -lsocket' >> Makefile.settings  	echo 'STRIP=\# skip strip' >> Makefile.settings  	echo 'EFLAGS+=-liconv' >> Makefile.settings;  ;;  Darwin ) -	echo 'Darwin/Mac OS X.'  	echo 'EFLAGS+=-liconv' >> Makefile.settings;  ;;  IRIX ) -	echo 'IRIX.'  ;;  CYGWIN* )  	echo 'Cygwin is not officially supported.'  ;;  * ) -	echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV. Please report any problems to <wilmer@gaast.net>.' +	echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV.' +	echo 'Please report any problems at http://bugs.bitlbee.org/.'  ;;  esac @@ -393,11 +391,11 @@ if [ "$msn" = "1" ]; then  	echo '  Using SSL library: '$ssl;  fi -if [ "$flood" = "0" ]; then -	echo '  Flood protection disabled.'; -else -	echo '  Flood protection enabled.'; -fi +#if [ "$flood" = "0" ]; then +#	echo '  Flood protection disabled.'; +#else +#	echo '  Flood protection enabled.'; +#fi  if [ -n "$protocols" ]; then  	echo '  Building with these protocols:' $protocols; diff --git a/doc/AUTHORS b/doc/AUTHORS index 82d81862..6dab1040 100644 --- a/doc/AUTHORS +++ b/doc/AUTHORS @@ -3,7 +3,7 @@ Current developers:  Wilmer van der Gaast <wilmer@gaast.net>  	Main developer -Jelmer 'ctrlsoft' Vernooij <jelmer@nl.linux.org> +Jelmer 'ctrlsoft' Vernooij <jelmer@samba.org>  	Documentation, general hacking, Win32 port  Maurits Dijkstra <mauritsd@xs4all.nl> diff --git a/doc/CHANGES b/doc/CHANGES index 2981a378..7b95e8cb 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -10,8 +10,26 @@ Version 1.0:  - Cleaned up some unnecessary code in the Jabber module, and implemented    handlers for headline messages (which allows you to use RSS-to-Jabber    gateways). - -Finished ... +- Lowered the line splitting limit a bit to fix data loss issues. +- The $proto($handle) format used for messages specific to one IM-connection +  now only include the ($handle) part when there's more than one $proto- +  connection. +- Fix for a crash-bug on broken Jabber/SSL connections. +- Incoming typing notifications now also come in as CTCP TYPING messages, for +  better consistency. Don't forget to update your scripts! +- AIM typing notifications are supported now. +- Jabber module only accepts ports 5220-5229 now, to prevent people from +  abusing it as a port scanner. We aren't aware of any Jabber server that +  runs on other ports than those. If you are, please warn us. +- Send flood protection can't be enabled anymore. It was disabled by default +  for a good reason for some time already, but some package maintainers +  turned it back on while it's way too unreliable and trigger-happy to be +  used. +- Removed TODO file, the current to-do list is always in the on-line bug +  tracking system. +- Fixed a potential DoS bug in input handling. + +Finished 4 Dec 2005  Version 0.99:  - Fixed memory initialization bug in OSCAR module that caused crashes on @@ -38,30 +38,18 @@ A: 'root' is just the name for the most powerful user in BitlBee. Just like     artistic creativity.  Q: When is $random_feature going to be implemented? -A: Please do consult doc/TODO (preferably in a development snapshot, which -   is more up-to-date than a TODO in a release version) before asking. -   Please also check the documentation. You'd not be the first one to request -   a feature which already exists! -    -   If your fabulous feature seems not to be requested before, just join -   #bitlbee on irc.oftc.net and tell us the news. -    -   If your feature request is already in the TODO list, of course you can -   still request it again/make us know that you'd like to see the feature as -   well. But when the feature is in the "post-1.0" list, it's probably not -   going to help. Most of the features in this list are low-priority because -   we (the developers) don't need (or even want) them. (File transfers are a -   good example here.) -   Hence, they'll only be implemented when we really got too much spare -   time. Obviously, if you're willing to help (i.e. submit a patch), you're -   always welcome. +A: It depends on the feature. We keep a list of all wishlist "bugs" in our +   Bug Tracking system at http://bugs.bitlbee.org/  Q: The messages I send and/or receive look weird. I see weird characters and     annoying HTML codes. Or, BitlBee does evil things when I send messages with     non-ASCII characters!  A: You probably have to change some settings. To get rid of HTML in messages, -   see "help set html". If you seem to have problems with your charset, see -   "help set charset". +   see "help set strip_html". If you seem to have problems with your charset, +   see "help set charset". +    +   Although actually most of these problems should be gone by now. So if you +   can't get things to work well, you might have found a bug.  Q: Is BitlBee forked from Gaim?  A: BitlBee 0.7 was, sort-of. It contained a lot of code from Gaim 0.58 @@ -107,11 +107,10 @@ not daemons).  See utils/bitlbeed.c for more information about the program. -Just a little note: We run our public server im.bitlbee.org for a couple of -months now, and so far we haven't experienced this problem yet. The only -BitlBee processes killed because of CPU-time overuse were running for a long -time already, they were usually killed during the MSN login process (which -is quite CPU-time consuming). +Just a little note: Now that we reach version 1.0, this shouldn't be that +much of an issue anymore. However, on a public server, especially if you +also use it for other things, it can't hurt to protect yourself against +possible problems.  USAGE @@ -145,6 +144,12 @@ WEBSITE  You can find new releases of BitlBee at:  http://www.bitlbee.org/ +The bug tracking system: +http://bugs.bitlbee.org/ + +Our version control system is Bazaar-NG. Our repository is at: +http://code.bitlbee.org/ +  A NOTE ON ENCRYPTION  ==================== @@ -186,5 +191,5 @@ also licensed under the GPL.  	BitlBee - An IRC to other chat networks gateway   	          <http://www.bitlbee.org/> -	Copyright (C) 2002-2004  Wilmer van der Gaast <wilmer@gaast.net> +	Copyright (C) 2002-2005  Wilmer van der Gaast <wilmer@gaast.net>  	                         and others diff --git a/doc/TODO b/doc/TODO deleted file mode 100644 index 3bd241ef..00000000 --- a/doc/TODO +++ /dev/null @@ -1,40 +0,0 @@ -TODO for BitlBee: - -We're trying to keep a better TODO list now. The priorities here are somewhat -random, maybe. Or at least they change from time to time. The "After 1.0" -changes are very low-priority, the "Before 1.0" are "highest" priority, the -others are changes we'll do when we feel like doing them. They're usually not -as critical as the "Before 1.0" changes, but still a bit more important than -"After 1.0". - -KNOWN BUGS TO FIX BEFORE 1.0: -- 100% cpu usage bugs. -  -> They're still there... :-( -- Check if the IRC send flood protection is reliable now. -  -> Probably not, at least it still causes troubles on logging in for some -     people. Maybe the thresholds aren't okay yet. Logins are just floody, -     nothing we can do about that. - -Some time: (mainly features) -- Rewrite Jabber module - the current one sucks. -- Test Yahoo! groupchats a bit better, because they still seem to be a bit -  flakey. -  -> There are bug reports from time to time, but we can't do much about -     them, possibly it's more a libyahoo2 problem. -- Groupchats -  -> Make them work on other nets than MSN/Yahoo as well. -- Make usernames case-insensitive. (On case-insensitive filesystems this -  change isn't necessary. This one is going to suck with backward-compati- -  bilty...) -  -> We'll probably combine this with the introduction of a better file -     format for userdata. -- Remind the user of unanswered questions after some time. -- Maybe a way to send global messages. (for server shutdowns, for example) -- Away-auto-replies. -- Allow nick changes. - -After 1.0: (mainly toys) -- File transfers -> DCC -- SSL support? Persistent connections? Things you can do with a bouncer/proxy. -- Support for buddy groups. -- What else? diff --git a/doc/user-guide/user-guide.xml b/doc/user-guide/user-guide.xml index eff5998e..5b881fb2 100644 --- a/doc/user-guide/user-guide.xml +++ b/doc/user-guide/user-guide.xml @@ -20,24 +20,13 @@  	</author>  	<legalnotice id="legalnotice"> -     <para> -         Permission is granted to copy, distribute and/or modify this  -         document under the terms of the <ulink type="help" -         url="gnome-help:fdl"><citetitle>GNU Free Documentation  -         License</citetitle></ulink>, Version 1.1 or any later version  -         published by the Free Software Foundation with no Invariant  -         Sections, no Front-Cover Texts, and no Back-Cover Texts. You  -         may obtain a copy of the <citetitle>GNU Free Documentation  -         License</citetitle> from the Free Software Foundation by  -         visiting <ulink type="http" url="http://www.fsf.org">their  -         Web site</ulink> or by writing to: Free Software Foundation,  -         Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,  -         USA. -       </para>      </legalnotice>     <releaseinfo> -   		This is the initial release of the BitlBee User Guide. +   		This is the BitlBee User Guide. For now, the on-line help is +		the most up-to-date documentation. Although this document shares +		some parts with the on-line help system, other parts might be +		very outdated.     </releaseinfo>    </bookinfo> @@ -1509,7 +1509,7 @@ int irc_privmsg( irc_t *irc, user_t *u, char *type, char *to, char *prefix, char  			else  			{  				irc_write( irc, ":%s!%s@%s %s %s :%s%s", u->nick, u->user, u->host, -				           type, to, prefix, line ); +				           type, to, prefix ? prefix : "", line );  			}  			line = s + 1;  		} diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 413f77ef..fc419124 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -21,10 +21,6 @@   *   */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -  #ifndef _WIN32  #include <sys/utsname.h>  #endif @@ -58,6 +54,8 @@  #define DEFAULT_GROUPCHAT "conference.jabber.org"  #define DEFAULT_PORT 5222  #define DEFAULT_PORT_SSL 5223 +#define JABBER_PORT_MIN 5220 +#define JABBER_PORT_MAX 5229  #define JABBER_GROUP "Friends" @@ -540,11 +538,6 @@ static void gjab_connected_ssl(gpointer data, void *source, GaimInputCondition c  	struct jabber_data *jd;  	gjconn gjc; -	if (!g_slist_find(get_connections(), gc)) { -		ssl_disconnect(source); -		return; -	} -	  	jd = gc->proto_data;  	gjc = jd->gjc; @@ -553,6 +546,11 @@ static void gjab_connected_ssl(gpointer data, void *source, GaimInputCondition c  		return;  	} +	if (!g_slist_find(get_connections(), gc)) { +		ssl_disconnect(source); +		return; +	} +	  	gjab_connected(data, gjc->fd, cond);  } @@ -588,6 +586,11 @@ static void gjab_start(gjconn gjc)  		port = DEFAULT_PORT;  	else if (port == -1 && ssl)  		port = DEFAULT_PORT_SSL; +	else if (port < JABBER_PORT_MIN || port > JABBER_PORT_MAX) { +		serv_got_crap(GJ_GC(gjc), "For security reasons, the Jabber port number must be in the %d-%d range.", JABBER_PORT_MIN, JABBER_PORT_MAX); +		STATE_EVT(JCONN_STATE_OFF) +		return; +	}  	if (server == NULL)  		server = g_strdup(gjc->user->server); diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 7eb0446e..b65ddaf5 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -451,7 +451,14 @@ void signoff( struct gaim_connection *gc )  void do_error_dialog( struct gaim_connection *gc, char *msg, char *title )  { -	serv_got_crap( gc, "Error: %s", msg ); +	if( msg && title ) +		serv_got_crap( gc, "Error: %s: %s", title, msg ); +	else if( msg ) +		serv_got_crap( gc, "Error: %s", msg ); +	else if( title ) +		serv_got_crap( gc, "Error: %s", title ); +	else +		serv_got_crap( gc, "Error" );  }  void do_ask_dialog( struct gaim_connection *gc, char *msg, void *data, void *doit, void *dont ) @@ -736,7 +743,7 @@ void serv_got_im( struct gaim_connection *gc, char *handle, char *msg, guint32 f  		/* If there's a newline/space in this string, split up there,  		   looks a bit prettier. */ -		if( ( nl = strrchr( msg, '\n' ) ) || ( nl = strchr( msg, ' ' ) ) ) +		if( ( nl = strrchr( msg, '\n' ) ) || ( nl = strrchr( msg, ' ' ) ) )  		{  			msg[425] = tmp;  			tmp = *nl; @@ -768,7 +775,7 @@ void serv_got_typing( struct gaim_connection *gc, char *handle, int timeout )  		return;  	if( ( u = user_findhandle( gc, handle ) ) ) -		irc_msgfrom( gc->irc, u->nick, "\1TYPING 1\1" ); +		irc_privmsg( gc->irc, u, "PRIVMSG", gc->irc->nick, NULL, "\1TYPING 1\1" );  }  void serv_got_chat_left( struct gaim_connection *gc, int id ) diff --git a/protocols/proxy.c b/protocols/proxy.c index 6d450c92..47ece91e 100644 --- a/protocols/proxy.c +++ b/protocols/proxy.c @@ -113,7 +113,7 @@ static gboolean gaim_io_invoke(GIOChannel *source, GIOCondition condition, gpoin  	return TRUE;  } -static void no_one_calls(gpointer data, gint source, GaimInputCondition cond) +static void gaim_io_connected(gpointer data, gint source, GaimInputCondition cond)  {  	struct PHB *phb = data;  	unsigned int len; @@ -162,7 +162,7 @@ static int proxy_connect_none(char *host, unsigned short port, struct PHB *phb)  	if (connect(fd, (struct sockaddr *)sin, sizeof(*sin)) < 0) {  		if (sockerr_again()) { -			phb->inpa = gaim_input_add(fd, GAIM_INPUT_WRITE, no_one_calls, phb); +			phb->inpa = gaim_input_add(fd, GAIM_INPUT_WRITE, gaim_io_connected, phb);  			phb->fd = fd;  		} else {  			closesocket(fd); diff --git a/protocols/yahoo/crypt.c b/protocols/yahoo/crypt.c index 00eed70b..5122e3af 100644 --- a/protocols/yahoo/crypt.c +++ b/protocols/yahoo/crypt.c @@ -22,10 +22,6 @@   * already had. isn't that lovely. people should just use linux or   * freebsd, crypt works properly on those systems. i hate solaris */ -#if HAVE_CONFIG_H -#  include <config.h> -#endif -  #if HAVE_STRING_H  #  include <string.h>  #elif HAVE_STRINGS_H diff --git a/protocols/yahoo/libyahoo2.c b/protocols/yahoo/libyahoo2.c index 62ceb0af..c691f18b 100644 --- a/protocols/yahoo/libyahoo2.c +++ b/protocols/yahoo/libyahoo2.c @@ -43,10 +43,6 @@   *   */ -#if HAVE_CONFIG_H -# include <config.h> -#endif -  #ifndef _WIN32  #include <unistd.h>  #endif diff --git a/protocols/yahoo/yahoo_httplib.c b/protocols/yahoo/yahoo_httplib.c index 41e31a23..dbbe2a84 100644 --- a/protocols/yahoo/yahoo_httplib.c +++ b/protocols/yahoo/yahoo_httplib.c @@ -19,10 +19,6 @@   *   */ -#if HAVE_CONFIG_H -# include <config.h> -#endif -  #include <stdio.h>  #include <stdlib.h> diff --git a/protocols/yahoo/yahoo_util.c b/protocols/yahoo/yahoo_util.c index cb155e3c..3c99cf44 100644 --- a/protocols/yahoo/yahoo_util.c +++ b/protocols/yahoo/yahoo_util.c @@ -19,10 +19,6 @@   *   */ -#if HAVE_CONFIG_H -# include <config.h> -#endif -  #if STDC_HEADERS  # include <string.h>  #else | 
