Changes in / [3f44e43:7a9d968]
- Files:
-
- 5 added
- 17 deleted
- 67 edited
Legend:
- Unmodified
- Added
- Removed
-
.travis.yml
r3f44e43 r7a9d968 1 sudo: false1 dist: precise 2 2 language: c 3 3 … … 31 31 - libpam0g-dev 32 32 - libldap2-dev 33 - fakeroot 34 - debhelper 35 - devscripts 33 36 coverity_scan: 34 37 project: -
Makefile
r3f44e43 r7a9d968 94 94 mkdir -p $(DESTDIR)$(SBINDIR) 95 95 $(INSTALL) -m 0755 $(OUTFILE) $(DESTDIR)$(SBINDIR)/$(OUTFILE) 96 ifdef IMPLIB 97 # import library for cygwin 98 mkdir -p $(DESTDIR)$(LIBDIR) 99 $(INSTALL) -m 0644 $(IMPLIB) $(DESTDIR)$(LIBDIR)/$(IMPLIB) 100 endif 96 101 97 102 uninstall-bin: 98 103 rm -f $(DESTDIR)$(SBINDIR)/$(OUTFILE) 104 ifdef IMPLIB 105 rm -f $(DESTDIR)$(LIBDIR)/$(IMPLIB) 106 endif 99 107 100 108 install-dev: … … 163 171 164 172 $(subdirs): 165 @$(MAKE) -C $@ $(MAKECMDGOALS)173 $(MAKE) -C $@ $(MAKECMDGOALS) 166 174 167 175 $(OTR_PI): %.so: $(_SRCDIR_)%.c 168 176 @echo '*' Building plugin $@ 169 @$(CC) $(CFLAGS) -fPIC -shared $(LDFLAGS) $< -o $@ $(OTRFLAGS)177 $(VERBOSE) $(CC) $(CFLAGS) -fPIC -shared $(LDFLAGS) $< -o $@ $(OTRFLAGS) 170 178 171 179 $(SKYPE_PI): $(_SRCDIR_)protocols/skype/skype.c 172 180 @echo '*' Building plugin skype 173 @$(CC) $(CFLAGS) $(LDFLAGS) $(SKYPEFLAGS) $< -o $@181 $(VERBOSE) $(CC) $(CFLAGS) $(LDFLAGS) $(SKYPEFLAGS) $< -o $@ 174 182 175 183 $(objects): %.o: $(_SRCDIR_)%.c 176 184 @echo '*' Compiling $< 177 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@185 $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 178 186 179 187 $(objects): Makefile Makefile.settings config.h … … 181 189 $(OUTFILE): $(objects) $(subdirs) 182 190 @echo '*' Linking $(OUTFILE) 183 @$(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LDFLAGS_BITLBEE) $(LDFLAGS) $(EFLAGS)184 ifn def DEBUG191 $(VERBOSE) $(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LDFLAGS_BITLBEE) $(LDFLAGS) $(EFLAGS) 192 ifneq ($(firstword $(STRIP)), \#) 185 193 @echo '*' Stripping $(OUTFILE) 186 @-$(STRIP) $(OUTFILE)194 $(VERBOSE) -$(STRIP) $(OUTFILE) 187 195 endif 188 196 -
bitlbee.h
r3f44e43 r7a9d968 36 36 37 37 #define PACKAGE "BitlBee" 38 #define BITLBEE_VERSION "3. 4.2"38 #define BITLBEE_VERSION "3.5.1" 39 39 #define VERSION BITLBEE_VERSION 40 40 #define BITLBEE_VER(a, b, c) (((a) << 16) + ((b) << 8) + (c)) 41 #define BITLBEE_VERSION_CODE BITLBEE_VER(3, 4, 2)41 #define BITLBEE_VERSION_CODE BITLBEE_VER(3, 5, 1) 42 42 #define BITLBEE_ABI_VERSION_CODE 1 43 43 -
configure
r3f44e43 r7a9d968 15 15 datadir='$prefix/share/bitlbee/' 16 16 config='/var/lib/bitlbee/' 17 libdir='$prefix/lib/' 17 18 plugindir='$prefix/lib/bitlbee/' 18 19 rpcplugindir='$plugindir/rpc/' … … 41 42 rpc=1 42 43 44 verbose=0 43 45 doc=1 44 46 debug=0 45 strip= 147 strip=0 46 48 gcov=0 47 49 asan=0 … … 129 131 --config=... $config 130 132 133 --verbose=0/1 Disable/enable verbose build $verbose 134 131 135 --msn=0/1 Disable/enable MSN part $msn 132 136 --jabber=0/1 Disable/enable Jabber part $jabber … … 174 178 datadir=$(eval echo "$datadir/" | sed 's/\/\{1,\}/\//g') 175 179 config=$(eval echo "$config/" | sed 's/\/\{1,\}/\//g') 180 libdir=$(eval echo "$libdir/" | sed 's/\/\{1,\}/\//g') 176 181 plugindir=$(eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g') 177 182 rpcplugindir=$(eval echo "$rpcplugindir/" | sed 's/\/\{1,\}/\//g') … … 199 204 RPCPLUGINDIR=$rpcplugindir 200 205 CONFIG=$config 206 LIBDIR=$libdir 201 207 INCLUDEDIR=$includedir 202 208 PCDIR=$pcdir … … 248 254 #define PLUGINDIR "$plugindir" 249 255 #define RPCPLUGINDIR "$rpcplugindir" 256 #define DATADIR "$datadir" 250 257 #define PIDFILE "$pidfile" 251 258 #define IPCSOCKET "$ipcsocket" … … 296 303 fi 297 304 305 if [ "$verbose" = "0" ]; then 306 echo 'VERBOSE=@' >> Makefile.settings 307 else 308 echo 'VERBOSE=' >> Makefile.settings 309 fi 310 311 cat <<EOF >>Makefile.settings 312 313 # Enable/disable output verbosity 314 ifdef V 315 ifeq (\$(V),1) 316 VERBOSE= 317 else 318 VERBOSE=@ 319 endif 320 endif 321 322 EOF 323 298 324 if [ "$debug" = "1" ]; then 299 325 echo 'DEBUG=1' >> Makefile.settings 300 326 CFLAGS="$CFLAGS -g3 -DDEBUG -O0" 301 327 else 302 [ -z "$CFLAGS" ] && CFLAGS="- O2 -fno-strict-aliasing"328 [ -z "$CFLAGS" ] && CFLAGS="-g -O2 -fno-strict-aliasing" 303 329 fi 304 330 … … 764 790 if [ "$doc" = "1" ]; then 765 791 # check this here just in case someone tries to install it in python2.4... 766 if ! $PYTHON -m xml.etree.ElementTree > /dev/null 2>&1; then792 if [ ! -e $srcdir/doc/user-guide/help.txt ] && ! $PYTHON -m xml.etree.ElementTree > /dev/null 2>&1; then 767 793 echo 768 794 echo 'ERROR: Python (>=2.5 or 3.x) is required to generate docs' … … 797 823 fi 798 824 825 pkgconfiglibs='' 826 case "$arch" in 827 CYGWIN* ) 828 pkgconfiglibs='-L${libdir} -lbitlbee -no-undefined' 829 esac 830 799 831 cat <<EOF >bitlbee.pc 800 832 prefix=$prefix … … 802 834 plugindir=$plugindir 803 835 rpcplugindir=$rpcplugindir 836 libdir=$libdir 837 datadir=$datadir 804 838 805 839 Name: bitlbee … … 807 841 Requires: glib-2.0 808 842 Version: $BITLBEE_VERSION 809 Libs: 843 Libs: $pkgconfiglibs 810 844 Cflags: -I\${includedir} 811 845 … … 925 959 ;; 926 960 CYGWIN* ) 961 echo 'EFLAGS+=-Wl,--export-all,--out-implib,libbitlbee.dll.a' >> Makefile.settings 962 echo 'IMPLIB=libbitlbee.dll.a' >> Makefile.settings 927 963 ;; 928 964 Windows ) -
dcc.c
r3f44e43 r7a9d968 92 92 struct sockaddr_storage saddr; 93 93 char *errmsg; 94 char host[ HOST_NAME_MAX];94 char host[NI_MAXHOST]; 95 95 char port[6]; 96 96 -
debian/README.Debian
r3f44e43 r7a9d968 1 *** NEWS (Version 1.2 and later) *** 2 3 Starting from version 1.2, BitlBee has a forking daemon mode. The Debian 4 package now uses this mode by default, instead of inetd mode. If you don't 5 want to use this, you can disable the init scripts (best way to do this is 6 by editing /etc/default/bitlbee) and restore the inetd.conf entry. This 7 should be necessary only once, it won't be touched during upgrades. 8 9 Another important change in BitlBee 1.2 is the file format used for your 10 personal settings. Everything's now saved in a single .xml (per account, 11 of course) file instead of $nick.accounts and $nick.nicks. One advantage 12 of this new format is that the passwords are actually encrypted instead of 13 just vaguely obfuscated. BitlBee can still read the old files, and will 14 save things in the new format when you save/disconnect. After that, you 15 can safely remove the old-style files (this is recommended). 16 17 I tried making this transition (the new file format but especially, in this 18 case, the inetd->forkdaemon mode change) as smooth as possible, but I'm 19 aware that many BitlBee users will have their own hacks already to run the 20 program. I hope the package won't break any of this for anyone. 1.2-2 21 should fix at least some of the issues. 22 23 --------------------------------------------------------------------------- 24 25 Debconf should have asked you on what port you want BitlBee to run. If it 26 did not, the port number should be 6667 or 6668. (6668 if you already got 27 something running at 6667) 28 29 Fire up your favourite IRC client and connect to localhost:6667 (or 6668), 1 Fire up your favourite IRC client and connect to localhost:6667, 30 2 and read the documentation (type help for a list of commands). 31 3 -
debian/bitlbee-common.init
r3f44e43 r7a9d968 23 23 [ -x $DAEMON ] || exit 0 24 24 25 # Default value26 BITLBEE_PORT=666727 25 BITLBEE_OPTS=-F 28 29 # Read config file if it is present.30 if [ -r /etc/default/$NAME ]; then31 . /etc/default/$NAME32 fi33 26 34 27 … … 42 35 43 36 start-stop-daemon --start --quiet --pidfile $PIDFILE \ 44 --exec $DAEMON -- - p $BITLBEE_PORT -P $PIDFILE $BITLBEE_OPTS37 --exec $DAEMON -- -P $PIDFILE $BITLBEE_OPTS 45 38 } 46 39 … … 56 49 case "$1" in 57 50 start) 58 [ "$BITLBEE_DISABLED" = "1" ] && exit 059 60 51 echo -n "Starting $DESC: $NAME" 61 52 d_start -
debian/bitlbee-common.postinst
r3f44e43 r7a9d968 3 3 set -e 4 4 5 . /usr/share/debconf/confmodule6 7 db_get bitlbee/serveport8 PORT="$RET"9 10 5 CONFDIR=/var/lib/bitlbee/ 11 6 12 ## Load default option. Don't want to put this in debconf (yet?) 13 BITLBEE_OPTS=-F 14 BITLBEE_DISABLED=0 15 BITLBEE_UPGRADE_DONT_RESTART=0 16 [ -r /etc/default/bitlbee ] && . /etc/default/bitlbee 17 18 if [ "$BITLBEE_DISABLED" = "0" ] && which update-inetd > /dev/null 2> /dev/null && 19 ( expr "$2" : '0\..*' > /dev/null || expr "$2" : '1\.0\..*' > /dev/null ); then 20 ## Make sure the inetd entry is gone (can still be there from a 21 ## previous version. 22 update-inetd --remove '.*/usr/sbin/bitlbee' 23 if grep -q /usr/sbin/bitlbee /etc/inetd.conf 2> /dev/null; then 24 # Thanks for breaking update-inetd! (bugs.debian.org/311111) 25 # I hope that it works at least with xinetd, because this 26 # emergency hack doesn't: 27 perl -pi -e 's:^[^#].*/usr/sbin/bitlbee$:## Now using daemon mode\: # $&:' /etc/inetd.conf 28 killall -HUP inetd || true 29 fi 30 fi 31 32 cat<<EOF>/etc/default/bitlbee 7 if [ -e /etc/default/bitlbee ]; then 8 cat <<EOF >/etc/default/bitlbee 33 9 ## /etc/default/bitlbee: Auto-generated/updated script. 34 10 ## 35 ## If running in (fork)daemon mode, listen on this TCP port. 36 BITLBEE_PORT="$PORT" 37 38 ## Use single-process or forking daemon mode? Can't be changed from debconf, 39 ## but maintainer scripts will save your changes here. 40 BITLBEE_OPTS="$BITLBEE_OPTS" 41 42 ## In case you want to stick with inetd mode (or if you just want to disable 43 ## the init scripts for some other reason), you can disable the init script 44 ## here. (Just set it to 1) 45 BITLBEE_DISABLED=$BITLBEE_DISABLED 46 47 ## As a server operator, you can use the RESTART command to restart only the 48 ## master process while keeping all the child processes and their IPC 49 ## connections. By enabling this, the maintainer scripts won't restart 50 ## BitlBee during upgrades so you can restart the master process by hand. 51 BITLBEE_UPGRADE_DONT_RESTART=$BITLBEE_UPGRADE_DONT_RESTART 11 ## This file is deprecated and no longer used. 12 ## Please edit /etc/bitlbee/bitlbee.conf instead 52 13 EOF 53 14 54 ## Bye-bye DebConf, we don't need you anymore. 55 db_stop 15 fi 56 16 57 17 ## Restore the helpfile in case we weren't upgrading but just reconfiguring: … … 64 24 fi 65 25 66 if [ "$BITLBEE_UPGRADE_DONT_RESTART" != "1" -a-n "$2" -a -x "/etc/init.d/bitlbee" ]; then26 if [ -n "$2" -a -x "/etc/init.d/bitlbee" ]; then 67 27 invoke-rc.d bitlbee restart 68 28 fi … … 71 31 if [ -d $CONFDIR ] && chown -R bitlbee: $CONFDIR; then 72 32 echo 'BitlBee (probably) already installed, skipping user/configdir installation' 73 exit 0 33 else 34 adduser --system --group --disabled-login --disabled-password --home /var/lib/bitlbee/ bitlbee 74 35 fi 75 36 76 adduser --system --group --disabled-login --disabled-password --home /var/lib/bitlbee/ bitlbee77 37 chmod 700 /var/lib/bitlbee/ 78 38 -
debian/bitlbee-common.postrm
r3f44e43 r7a9d968 5 5 if [ "$1" = "purge" ]; then 6 6 rm -f /etc/default/bitlbee 7 deluser --system bitlbee || true7 deluser --system bitlbee > /dev/null || true 8 8 rm -rf /var/lib/bitlbee ## deluser doesn't seem to do this for homedirs in /var 9 9 fi -
debian/changelog
r3f44e43 r7a9d968 1 bitlbee (3.5-2) unstable; urgency=medium 2 3 * TFW you find out the corrected fix diff posted on #821967 was still the 4 broken one and you end up doing your third upload in a weekend. :-( 5 Obviously build-* targets shouldn't call into binary-*, as that one 6 starts requiring root. This broke builds on buildd's. 7 * Now contains the same fix like 3.4.2-1.1, which as it turns out 3.5-1.1 8 did not. (Closes: #853017) 9 10 -- Wilmer van der Gaast <wilmer@gaast.net> Sat, 28 Jan 2017 21:06:27 +0000 11 12 bitlbee (3.5-1.1) unstable; urgency=medium 13 14 [ dequis ] 15 * Merge back changes from 3.4.2-1.1 (Closes: #852897) 16 17 -- dequis <dx@dxzone.com.ar> Thu, 26 Jan 2017 21:39:24 -0300 18 19 bitlbee (3.5-1) unstable; urgency=medium 20 21 [ Jochen Sprickerhof ] 22 * Drop dependency on net-tools 23 24 [ dequis ] 25 * Use dh_systemd 26 * Drop support for /etc/default/bitlbee 27 * Drop debconf and its translations (only used to ask for the port) 28 * Add preinst script for a smoother transition to systemd units 29 * Ignore the stdout of deluser, fixes postrm error exit code 30 * Remove some mentions of yahoo in control and copyright 31 * Remove outdated stuff from README.debian 32 33 [ Wilmer van der Gaast ] 34 * New upstream release. 35 36 -- Wilmer van der Gaast <wilmer@gaast.net> Tue, 24 Jan 2017 22:21:33 +0000 37 38 bitlbee (3.4.2-1.1) unstable; urgency=medium 39 40 * Non-maintainer upload. 41 * Adding build-{arch,indep} targets. (Closes: #821967) 42 * Added python to build depends. 43 44 -- Michael Lustfield <michael@lustfield.net> Mon, 18 Jul 2016 01:02:17 -0700 45 1 46 bitlbee (3.4.2-1) unstable; urgency=medium 2 47 -
debian/control
r3f44e43 r7a9d968 5 5 Uploaders: Jelmer Vernooij <jelmer@debian.org> 6 6 Standards-Version: 3.9.8 7 Build-Depends: libglib2.0-dev (>= 2.4), libevent-dev, libgnutls28-dev | libgnutls-dev | gnutls-dev, po-debconf, libpurple-dev, libotr5-dev, debhelper (>= 6.0.7~), dh-systemd (>= 1.5) | debhelper (<< 9.20131227) 7 Build-Depends: libglib2.0-dev (>= 2.4), libevent-dev, libgnutls28-dev | libgnutls-dev | gnutls-dev, po-debconf, libpurple-dev, libotr5-dev, debhelper (>= 6.0.7~), dh-systemd (>= 1.5) | debhelper (<< 9.20131227), python 8 8 Homepage: http://www.bitlbee.org/ 9 9 Vcs-Git: https://github.com/bitlbee/bitlbee … … 17 17 Description: IRC to other chat networks gateway (default version) 18 18 This program can be used as an IRC server which forwards everything you 19 say to people on other chat networks: Jabber (which includes Google Talk20 and Facebook Chat), ICQ, AIM, MSN, Yahoo! and Twitter/Identica/Status.net.19 say to people on other chat networks: Jabber (which includes Google 20 Talk), ICQ, AIM, MSN and Twitter. 21 21 22 22 Package: bitlbee-libpurple … … 27 27 Description: IRC to other chat networks gateway (using libpurple) 28 28 This program can be used as an IRC server which forwards everything you 29 say to people on other chat networks: Jabber (which includes Google Talk30 and Facebook Chat), ICQ, AIM, MSN, Yahoo! and Twitter/Identica/Status.net.29 say to people on other chat networks: Jabber (which includes Google 30 Talk), ICQ, AIM, MSN and Twitter. 31 31 . 32 32 This package contains a version of BitlBee that uses the libpurple instant … … 39 39 Package: bitlbee-common 40 40 Architecture: all 41 Depends: ${misc:Depends}, net-tools,adduser41 Depends: ${misc:Depends}, adduser 42 42 Replaces: bitlbee 43 43 Description: IRC to other chat networks gateway (common files/docs) 44 44 This program can be used as an IRC server which forwards everything you 45 say to people on other chat networks: Jabber (which includes Google Talk46 and Facebook Chat), ICQ, AIM, MSN, Yahoo! and Twitter/Identica/Status.net.45 say to people on other chat networks: Jabber (which includes Google 46 Talk), ICQ, AIM, MSN and Twitter. 47 47 . 48 48 This package contains common files (mostly documentation) for bitlbee and … … 54 54 Description: IRC to other chat networks gateway (dev files) 55 55 This program can be used as an IRC server which forwards everything you 56 say to people on other chat networks: Jabber (which includes Google Talk57 and Facebook Chat), ICQ, AIM, MSN, Yahoo! and Twitter/Identica/Status.net.56 say to people on other chat networks: Jabber (which includes Google 57 Talk), ICQ, AIM, MSN and Twitter. 58 58 . 59 59 This package holds development stuff for compiling plug-ins. … … 64 64 Description: IRC to other chat networks gateway (OTR plugin) 65 65 This program can be used as an IRC server which forwards everything you 66 say to people on other chat networks: Jabber (which includes Google Talk67 and Facebook Chat), ICQ, AIM, MSN, Yahoo! and Twitter/Identica/Status.net.66 say to people on other chat networks: Jabber (which includes Google 67 Talk), ICQ, AIM, MSN and Twitter. 68 68 . 69 69 This package contains a plugin that adds support for Off-The-Record … … 76 76 Description: IRC to other chat networks gateway (Skype plugin) 77 77 This program can be used as an IRC server which forwards everything you 78 say to people on other chat networks: Jabber (which includes Google Talk79 and Facebook Chat), ICQ, AIM, MSN, Yahoo! and Twitter/Identica/Status.net.78 say to people on other chat networks: Jabber (which includes Google 79 Talk), ICQ, AIM, MSN and Twitter. 80 80 . 81 81 This package contains a plugin that adds support for the Skype IM network. -
debian/copyright
r3f44e43 r7a9d968 11 11 12 12 Bits of third party code, also (L)GPLed: 13 * protocols/yahoo/ is libyahoo2 <http://libyahoo2.sf.net/>.14 13 * Some parts (though there is very little left at this point) are borrowed 15 14 from Gaim (version 0.58), now known as Pidgin <http://www.pidgin.im/>. … … 18 17 * lib/json.[ch] is from <https://github.com/udp/json-parser> and licensed 19 18 under the modified BSD license. 19 * lib/canohost.[ch] is from OpenSSH and licenced under the BSD-3-clause 20 licence. 20 21 21 22 -
debian/rules
r3f44e43 r7a9d968 41 41 42 42 HAS_DH_SYSTEMD:=$(shell dpkg-query -W -f='$${Status}' dh-systemd 2>/dev/null | grep -c "ok installed") 43 44 # No difference at the build stage so just call main build target. 45 # (Well indep could be docs-only but we prebuild them plus it's really 46 # not that much work.) 47 build-arch build-indep: build 43 48 44 49 build: build-stamp … … 115 120 dh_installdebconf 116 121 ifeq ($(HAS_DH_SYSTEMD),1) 117 dh_systemd_enable 122 dh_systemd_enable --no-enable bitlbee.socket 123 dh_systemd_enable bitlbee.service 118 124 dh_installinit --init-script=bitlbee 119 125 dh_systemd_start -
doc/CHANGES
r3f44e43 r7a9d968 3 3 4 4 https://github.com/bitlbee/bitlbee/commits/master 5 6 Version 3.5.1: 7 8 - purple: 9 * Fix crash on file transfer requests from unknown contacts. This was the 10 result of an incomplete fix in the previous release and may result in 11 remote DoS. Read the full security advisory at: 12 https://bugs.bitlbee.org/ticket/1282 13 - After some investigation we decided to reclassify a crash fix from the 14 previous release as a security issue. Read the full security advisory at: 15 https://bugs.bitlbee.org/ticket/1281 16 - Included help.txt in the release tarball, which was missing in the previous 17 release and resulted in adding python as a build dependency. The release 18 tarball of 3.5.1 does not require python. 19 20 Finished 30 Jan 2017 21 22 Version 3.5: 23 24 - ui: 25 * "chat list": shows a list of existing server-side chatrooms. With some 26 protocols, this is often the only way to add new channels. 27 See 'help chat list' for details. (jgeboski) 28 * "plugins": lists the installed plugins and their versions (jgeboski) 29 * Add 'nick_lowercase' and 'nick_underscores' settings. 30 * "handle_unknown" can be set per-account, not just globally 31 32 - jabber: 33 * Add "always_use_nicks" channel setting, for non-anonymous MUCs (trac #415) 34 See 'help set always_use_nicks' for possible side effects. 35 * Properly handle rejected file transfers 36 * Don't send parts in a chat if someone is still connected from other devices 37 * hipchat: support personal oauth tokens (manually generated ones) 38 39 - twitter: 40 * Hide muted tweets / no-retweets, add mute/unmute commands (Flexo) 41 * Show full version of extended tweets (with slightly more than 140 chars) 42 43 - purple: 44 * Support setting chat room topics (EionRobb) 45 * Support for extra groupchat settings. Shows an error if any required 46 ones are missing. Look for purple_ prefixed settings in "chan #... set" 47 * SIPE: persistent chats can be joined now, thanks to the "chat list" command 48 and the above ("purple_uri" channel setting) 49 * Fix a file transfer crash bug (Mainly affected telegram) 50 * Honor protocol flag to not require a password (used in hangouts, telegram) 51 * Set the contacts' nicks to the %full_name for a few whitelisted protocols 52 (hangouts, funyahoo, icq, line) 53 * LINE: added a hack to save its auth token, to avoid re-auth every time 54 * Show self-messages in groupchat backlogs (before join) 55 56 - yahoo: 57 * Removed because they killed their old protocol on a two month notice. 58 Use EionRobb's funyahoo purple plugin, or better yet, don't use yahoo. 59 60 - Stuff for enterprise deployments (all done by Sevas) 61 * Locked down accounts, useful when pregenerating user config files. An 62 account that is marked with the locked="true" attribute can't be removed 63 and its username/password can't be changed. 64 * Locked down settings. Same as above, but for individual account settings. 65 * AllowAccountAdd setting in bitlbee.conf, to disable adding new accounts. 66 * PAM and LDAP authentication backends (not compiled by default) 67 68 - For packagers: 69 * Enabled debug symbols in non-debug builds, disabled stripping by default. 70 This is closer to the default behavior of autotools, and --debug=1 is mostly 71 to set the DEBUG macro and disable optimization. 72 73 - For plugin devs: 74 * Plugins should now include an "init_plugin_info" function which will be used 75 for ABI version checking in the future. It's optional for now, but will be 76 enforced later. See the commit log of d28fe1c for details. (jgeboski) 77 78 Finished 8 Jan 2017 5 79 6 80 Version 3.4.2: -
doc/README
r3f44e43 r7a9d968 161 161 file COPYING for this license. 162 162 163 The Yahoo! library used by BitlBee is libyahoo2 <http://libyahoo2.sf.net/>,164 also licensed under the GPL.165 166 163 167 164 BitlBee - An IRC to other chat networks gateway -
doc/bitlbee.8
r3f44e43 r7a9d968 39 39 networks and acts as a gateway. Users can connect to the server 40 40 with any normal IRC client and see their 'buddy list' in 41 &bitlbee. It currently supports Oscar (AIM and ICQ), 42 MSN, Jabber, Yahoo! and Twitter. 41 &bitlbee. 43 42 44 43 \fBbitlbee\fP should be called by -
doc/user-guide/Installation.xml
r3f44e43 r7a9d968 36 36 settings and buddy information. <filename>/var/lib/bitlbee/</filename> 37 37 is the default value.</para></listitem> 38 <listitem><para>msn, jabber, oscar, yahoo- By default, support for all38 <listitem><para>msn, jabber, oscar, twitter - By default, support for all 39 39 these IM-protocols (OSCAR is the protocol used by both ICQ and AIM) will 40 40 be compiled in. To make the binary a bit smaller, you can use these options -
doc/user-guide/Makefile
r3f44e43 r7a9d968 35 35 xsltproc --xinclude --output $@ docbook.xsl $< 36 36 37 help.txt: $(_SRCDIR_)help.xml $(_SRCDIR_)commands.xml $(_SRCDIR_)misc.xml $(_SRCDIR_)quickstart.xml 37 help.txt: $(_SRCDIR_)help.xml $(_SRCDIR_)commands.xml $(_SRCDIR_)misc.xml $(_SRCDIR_)quickstart.xml $(_SRCDIR_)twitter.xml 38 38 $(PYTHON) $(_SRCDIR_)genhelp.py $< $@ 39 39 -
doc/user-guide/commands.xml
r3f44e43 r7a9d968 21 21 <description> 22 22 <para> 23 Adds an account on the given server with the specified protocol, username and password to the account list. Supported protocols right now are: Jabber, MSN, OSCAR (AIM/ICQ), Yahoo and Twitter. For more information about adding an account, see <emphasis>help account add <protocol></emphasis>.23 Adds an account on the given server with the specified protocol, username and password to the account list. For a list of supported protocols, use the <emphasis>plugins</emphasis> command. For more information about adding an account, see <emphasis>help account add <protocol></emphasis>. 24 24 </para> 25 25 … … 184 184 <bitlbee-command name="channel"> 185 185 <short-description>Channel list maintenance</short-description> 186 <syntax>channel [< accountid>] <action> [<arguments>]</syntax>186 <syntax>channel [<channel id>] <action> [<arguments>]</syntax> 187 187 188 188 <description> … … 277 277 <description> 278 278 <para> 279 List existing chatrooms provided by an account. BitlBee needs this to propogate an internal list of chats. The existing chat can then be added with <emphasis>chat add</emphasis>, using the number in the index column after a "!" as a shortcut. 279 List existing named chatrooms provided by an account. Chats from this list can be referenced from <emphasis>chat add</emphasis> by using the number in the index column after a "!" as a shortcut. 280 </para> 281 282 <para> 283 The server parameter is optional and currently only used by jabber. 280 284 </para> 281 285 </description> … … 338 342 <description> 339 343 <para> 340 Requests IM-network-specific information about the specified user. The amount of information you'll get differs per protocol. For some protocols (ATM Yahoo! and MSN)it'll give you an URL which you can visit with a normal web browser to get the information.344 Requests IM-network-specific information about the specified user. The amount of information you'll get differs per protocol. For some protocols it'll give you an URL which you can visit with a normal web browser to get the information. 341 345 </para> 342 346 </description> … … 887 891 <description> 888 892 <para> 889 With this setting enabled, you can use some commands in your Twitter channel/query. The commands are simple and not documented in too much detail: 890 </para> 891 892 <variablelist> 893 <varlistentry><term>undo #[<id>]</term><listitem><para>Delete your last Tweet (or one with the given ID)</para></listitem></varlistentry> 894 <varlistentry><term>rt <screenname|#id></term><listitem><para>Retweet someone's last Tweet (or one with the given ID)</para></listitem></varlistentry> 895 <varlistentry><term>reply <screenname|#id></term><listitem><para>Reply to a Tweet (with a reply-to reference)</para></listitem></varlistentry> 896 <varlistentry><term>rawreply <screenname|#id></term><listitem><para>Reply to a Tweet (with no reply-to reference)</para></listitem></varlistentry> 897 <varlistentry><term>report <screenname|#id></term><listitem><para>Report the given user (or the user who posted the tweet with the given ID) for sending spam. This will also block them.</para></listitem></varlistentry> 898 <varlistentry><term>follow <screenname></term><listitem><para>Start following a person</para></listitem></varlistentry> 899 <varlistentry><term>unfollow <screenname></term><listitem><para>Stop following a person</para></listitem></varlistentry> 900 <varlistentry><term>favourite <screenname|#id></term><listitem><para>Favo<emphasis>u</emphasis>rite the given user's most recent tweet, or the given tweet ID.</para></listitem></varlistentry> 901 <varlistentry><term>post <message></term><listitem><para>Post a tweet</para></listitem></varlistentry> 902 <varlistentry><term>url <screenname|#id></term><listitem><para>Show URL for a tweet to open it in a browser (and see context)</para></listitem></varlistentry> 903 </variablelist> 904 905 <para> 906 Anything that doesn't look like a command will be treated as a tweet. Watch out for typos, or to avoid this behaviour, you can set this setting to <emphasis>strict</emphasis>, which causes the <emphasis>post</emphasis> command to become mandatory for posting a tweet. 893 With this setting enabled, you can use some commands in your Twitter channel/query. See <emphasis>help twitter</emphasis> for the list of extra commands available. 907 894 </para> 908 895 </description> … … 1004 991 </bitlbee-setting> 1005 992 1006 <bitlbee-setting name="handle_unknown" type="string" scope=" global">993 <bitlbee-setting name="handle_unknown" type="string" scope="account,global"> 1007 994 <default>add_channel</default> 1008 <possible-values> root, add,add_private, add_channel, ignore</possible-values>1009 1010 <description> 1011 <para> 1012 By default, messages from people who aren't in your contact list are shown in a control channel instead of as a private message.995 <possible-values>add_private, add_channel, ignore</possible-values> 996 997 <description> 998 <para> 999 By default, messages from people who aren't in your contact list are shown in a control channel (add_channel) instead of as a private message (add_private) 1013 1000 </para> 1014 1001 1015 1002 <para> 1016 1003 If you prefer to ignore messages from people you don't know, you can set this one to "ignore". "add_private" and "add_channel" are like add, but you can use them to make messages from unknown buddies appear in the channel instead of a query window. 1004 </para> 1005 1006 <para> 1007 This can be set to individual accounts, which is useful to only ignore accounts that are targeted by spammers, without missing messages from legitimate unknown contacts in others. Note that incoming add requests are visible regardless of this setting. 1017 1008 </para> 1018 1009 … … 1037 1028 </bitlbee-setting> 1038 1029 1039 <bitlbee-setting name="lcnicks" type="boolean" scope="global">1040 <default>true</default>1041 1042 <description>1043 <para>1044 Hereby you can change whether you want all lower case nick names or leave the case as it intended by your peer.1045 </para>1046 </description>1047 1048 </bitlbee-setting>1049 1050 1030 <bitlbee-setting name="local_display_name" type="boolean" scope="account"> 1051 1031 <default>false</default> … … 1064 1044 <description> 1065 1045 <para> 1066 Some protocols (MSN, Yahoo!, GTalk) can notify via IM about new e-mail. Since most people use their Hotmail/Yahoo! addresses as a spam-box, this is disabled default. If you want these notifications, you can enable this setting.1046 Some protocols can notify via IM about new e-mail. If you want these notifications, you can enable this setting. 1067 1047 </para> 1068 1048 </description> … … 1212 1192 </para> 1213 1193 </description> 1194 </bitlbee-setting> 1195 1196 <bitlbee-setting name="nick_lowercase" type="boolean" scope="global"> 1197 <default>true</default> 1198 1199 <description> 1200 <para> 1201 If enabled, all nicknames are turned into lower case. 1202 </para> 1203 1204 <para> 1205 See also the <emphasis>nick_underscores</emphasis> setting. This setting was previously known as <emphasis>lcnicks</emphasis>. 1206 </para> 1207 </description> 1208 1209 </bitlbee-setting> 1210 1211 <bitlbee-setting name="nick_underscores" type="boolean" scope="global"> 1212 <default>true</default> 1213 1214 <description> 1215 <para> 1216 If enabled, spaces in nicknames are turned into underscores instead of being stripped. 1217 </para> 1218 1219 <para> 1220 See also the <emphasis>nick_lowercase</emphasis> setting. 1221 </para> 1222 </description> 1223 1214 1224 </bitlbee-setting> 1215 1225 … … 1850 1860 <bitlbee-command name="plugins"> 1851 1861 <short-description>List all the external plugins and protocols</short-description> 1852 <syntax>plugins </syntax>1862 <syntax>plugins [info <name>]</syntax> 1853 1863 1854 1864 <description> 1855 1865 <para> 1856 1866 This gives you a list of all the external plugins and protocols. 1867 </para> 1868 1869 <para> 1870 Use the <emphasis>info</emphasis> subcommand to get more details about a plugin. 1857 1871 </para> 1858 1872 </description> -
doc/user-guide/genhelp.py
r3f44e43 r7a9d968 73 73 74 74 def process_file(filename, parent=None): 75 tree = ET.parse(open(filename)).getroot() 75 try: 76 tree = ET.parse(open(filename)).getroot() 77 except: 78 sys.stderr.write("\nException while processing %s\n" % filename) 79 raise 76 80 fix_tree(tree) 77 81 return parse_tag(tree, parent) -
doc/user-guide/help.xml
r3f44e43 r7a9d968 18 18 <varlistentry><term>groupchats</term><listitem><para>How to work with groupchats on BitlBee</para></listitem></varlistentry> 19 19 <varlistentry><term>nick_changes</term><listitem><para>Changing your nickname without losing any settings</para></listitem></varlistentry> 20 <varlistentry><term> smileys</term><listitem><para>A summary of some non-standard smileys you might find and fail to understand</para></listitem></varlistentry>20 <varlistentry><term>identify_methods</term><listitem><para>A list of ways to (auto-)identify to your account</para></listitem></varlistentry> 21 21 </variablelist> 22 22 … … 49 49 <varlistentry><term>groupchats</term><listitem><para>How to work with groupchats on BitlBee</para></listitem></varlistentry> 50 50 <varlistentry><term>nick_changes</term><listitem><para>Changing your nickname without losing any settings</para></listitem></varlistentry> 51 <varlistentry><term> smileys</term><listitem><para>A summary of some non-standard smileys you might find and fail to understand</para></listitem></varlistentry>51 <varlistentry><term>identify_methods</term><listitem><para>A list of ways to (auto-)identify to your account</para></listitem></varlistentry> 52 52 </variablelist> 53 53 … … 60 60 <xi:include href="quickstart.xml"/> 61 61 <xi:include href="commands.xml"/> 62 <xi:include href="twitter.xml"/> 62 63 <xi:include href="misc.xml"/> 63 64 -
doc/user-guide/misc.xml
r3f44e43 r7a9d968 77 77 78 78 <para> 79 Some protocols (like Jabber) also support named groupchats. BitlBee now supports these too. You can use the <emphasis>chat add</emphasis> command to join them. See <emphasis>help chat add</emphasis> for more information. 80 </para> 81 79 Some protocols (like Jabber) also support named groupchats. BitlBee supports these too. You can use the <emphasis>chat add</emphasis> command to join them. See <emphasis>help chat add</emphasis> for more information. 80 </para> 81 82 <para> 83 If you don't know the name of a named groupchat, you can try the <emphasis>chat list</emphasis> command to get a list of chatrooms from a server. See <emphasis>help chat list</emphasis> for usage instructions. 84 </para> 82 85 </sect1> 83 86 … … 265 268 everything in the handle up to the first @. 266 269 </para> 270 271 </sect1> 272 273 <sect1 id="identify_methods"> 274 <title>Identifying to your BitlBee account</title> 275 276 <para>There are several methods to identify (log in) to your registered BitlBee account. All of these are equivalent:</para> 277 278 <variablelist> 279 <varlistentry> 280 <term>The 'identify' command</term> 281 <listitem><para>sent to &bitlbee or root. See <emphasis>help identify</emphasis> for details.</para></listitem> 282 </varlistentry> 283 <varlistentry> 284 <term>/msg nickserv identify</term> 285 <listitem><para>Same as above, but sent to NickServ. Useful with some auto-identify scripts.</para></listitem> 286 </varlistentry> 287 <varlistentry> 288 <term>/nickserv or /ns</term> 289 <listitem><para>Same as above, but using the command aliases to NickServ.</para></listitem> 290 </varlistentry> 291 <varlistentry> 292 <term>Server password</term> 293 <listitem><para>A field in the server connection settings of your irc client.</para></listitem> 294 </varlistentry> 295 <varlistentry> 296 <term>SASL PLAIN</term> 297 <listitem><para>A newer method, good choice if your client supports it. (Note: "SASL" is <emphasis>not</emphasis> related to "SSL")</para></listitem> 298 </varlistentry> 299 </variablelist> 300 301 <para>To configure your client to auto-identify, the last two methods are recommended. SASL if you have it, but server password is often the easiest.</para> 302 303 <para>Note: If you changed bitlbee.conf to have <emphasis>AuthMode = Closed</emphasis>, server password will be used for that instead. If you have never heard of that setting before, you can ignore it and just use it.</para> 267 304 268 305 </sect1> … … 462 499 </sect1> 463 500 501 <sect1 id="whatsnew030500"> 502 <title>New stuff in BitlBee 3.5</title> 503 504 <simplelist> 505 <member>New commands: <emphasis>chat list</emphasis> and <emphasis>plugins</emphasis>. New settings: <emphasis>nick_lowercase</emphasis>, <emphasis>nick_underscores</emphasis></member> 506 <member><emphasis>twitter:</emphasis> Hide muted tweets / no-retweets, add mute/unmute commands. Show full version of extended tweets.</member> 507 <member><emphasis>jabber:</emphasis> <emphasis>always_use_nicks</emphasis> channel setting. Don't send parts in a chat if someone is still connected from other devices. Personal oauth token login for hipchat.</member> 508 <member><emphasis>purple:</emphasis> Setting /topic. Fixes for SIPE and LINE. Don't ask for password if not needed (hangouts, telegram). Set nicks to %full_name for a few protocols (hangouts, funyahoo, icq, line)</member> 509 </simplelist> 510 511 <para> 512 See the full changelog for details! 513 </para> 514 515 </sect1> 516 464 517 </chapter> -
doc/user-guide/quickstart.xml
r3f44e43 r7a9d968 3 3 4 4 <para> 5 Welcome to BitlBee, your IRC gateway to ICQ, MSN, AOL, Jabber, Yahoo! and Twitter.5 Welcome to BitlBee, your IRC gateway to other instant messaging protocols. 6 6 </para> 7 7 … … 43 43 44 44 <para> 45 Other available IM protocols are msn, oscar, yahoo and twitter. OSCAR is the protocol used by ICQ and AOL. For more information about the <emphasis>account add</emphasis> command, see <emphasis>help account add</emphasis>. 45 Other built-in IM protocols include msn, oscar and twitter. OSCAR is the protocol used by ICQ and AOL. Some protocols may be available as plugins that you can install, such as facebook, steam, discord and omegle. And you can get even more protocols by using the libpurple variant of BitlBee. 46 </para> 47 48 <para> 49 For a list of currently supported protocols, use the <emphasis>plugins</emphasis> command. For more information about the <emphasis>account add</emphasis> command, see <emphasis>help account add</emphasis>. 46 50 </para> 47 51 … … 136 140 137 141 <para> 138 If you're still looking for something, please visit us in #bitlbee on the OFTC network ( you can connect via irc.bitlbee.org), or mail us your problem/suggestion. Good luck and enjoy the Bee!142 If you're still looking for something, please visit us in #bitlbee on the OFTC network (irc.oftc.net). Good luck and enjoy the Bee! 139 143 </para> 140 144 -
doc/user-guide/user-guide.xml
r3f44e43 r7a9d968 37 37 <xi:include href="quickstart.xml"/> 38 38 <xi:include href="commands.xml"/> 39 <xi:include href="twitter.xml"/> 39 40 <xi:include href="misc.xml"/> 40 41 -
init/bitlbee.service.in
r3f44e43 r7a9d968 1 1 [Unit] 2 2 Description=BitlBee IRC/IM gateway 3 After=syslog.target4 3 5 4 [Service] -
init/bitlbee@.service.in
r3f44e43 r7a9d968 1 1 [Unit] 2 2 Description=BitlBee Per-Connection Server 3 After=syslog.target4 3 5 4 [Service] 6 5 ExecStart=@sbindir@bitlbee -I 7 6 StandardInput=socket 7 StandardError=syslog 8 8 User=bitlbee -
ipc.c
r3f44e43 r7a9d968 898 898 strcpy(un_addr.sun_path, IPCSOCKET); 899 899 900 serversock = socket(AF_UNIX, SOCK_STREAM, PF_UNIX);900 serversock = socket(AF_UNIX, SOCK_STREAM, 0); 901 901 902 902 if (serversock == -1) { -
irc.c
r3f44e43 r7a9d968 25 25 26 26 #include "bitlbee.h" 27 #include "canohost.h" 27 28 #include "ipc.h" 28 29 #include "dcc.h" … … 41 42 { 42 43 irc_t *irc; 43 struct sockaddr_storage sock;44 socklen_t socklen = sizeof(sock);45 char *host = NULL, *myhost = NULL;46 44 irc_user_t *iu; 47 45 GSList *l; … … 64 62 irc->iconv = (GIConv) - 1; 65 63 irc->oconv = (GIConv) - 1; 66 67 if (global.conf->hostname) {68 myhost = g_strdup(global.conf->hostname);69 } else if (getsockname(irc->fd, (struct sockaddr*) &sock, &socklen) == 0) {70 char buf[NI_MAXHOST + 1];71 72 if (getnameinfo((struct sockaddr *) &sock, socklen, buf,73 NI_MAXHOST, NULL, 0, 0) == 0) {74 myhost = g_strdup(ipv6_unwrap(buf));75 }76 }77 78 if (getpeername(irc->fd, (struct sockaddr*) &sock, &socklen) == 0) {79 char buf[NI_MAXHOST + 1];80 81 if (getnameinfo((struct sockaddr *) &sock, socklen, buf,82 NI_MAXHOST, NULL, 0, 0) == 0) {83 host = g_strdup(ipv6_unwrap(buf));84 }85 }86 87 if (host == NULL) {88 host = g_strdup("localhost.localdomain");89 }90 if (myhost == NULL) {91 myhost = g_strdup("localhost.localdomain");92 }93 64 94 65 if (global.conf->ping_interval > 0 && global.conf->ping_timeout > 0) { … … 113 84 s = set_add(&b->set, "last_version", "0", NULL, irc); 114 85 s->flags |= SET_HIDDEN; 115 s = set_add(&b->set, "lcnicks", "true", set_eval_bool, irc);116 86 s = set_add(&b->set, "nick_format", "%-@nick", NULL, irc); 87 s = set_add(&b->set, "nick_lowercase", "false", set_eval_bool, irc); 88 s = set_add(&b->set, "nick_underscores", "false", set_eval_bool, irc); 117 89 s = set_add(&b->set, "offline_user_quits", "true", set_eval_bool, irc); 118 90 s = set_add(&b->set, "ops", "both", set_eval_irc_channel_ops, irc); … … 137 109 138 110 irc->root = iu = irc_user_new(irc, ROOT_NICK); 139 iu->host = g_strdup(myhost);140 111 iu->fullname = g_strdup(ROOT_FN); 141 112 iu->f = &irc_user_root_funcs; 142 113 143 114 iu = irc_user_new(irc, NS_NICK); 144 iu->host = g_strdup(myhost);145 115 iu->fullname = g_strdup(ROOT_FN); 146 116 iu->f = &irc_user_root_funcs; 147 117 148 118 irc->user = g_new0(irc_user_t, 1); 149 irc->user->host = g_strdup(host); 119 120 irc_set_hosts(irc, NULL, 0); 150 121 151 122 conf_loaddefaults(irc); … … 163 134 } 164 135 165 g_free(myhost);166 g_free(host);167 168 136 /* libpurple doesn't like fork()s after initializing itself, so this 169 137 is the right moment to initialize it. */ … … 185 153 186 154 return irc; 155 } 156 157 void irc_set_hosts(irc_t *irc, const struct sockaddr *remote_addr, const socklen_t remote_addrlen) 158 { 159 struct sockaddr_storage sock; 160 socklen_t socklen = sizeof(sock); 161 char *host = NULL, *myhost = NULL; 162 struct irc_user *iu; 163 164 if (global.conf->hostname) { 165 myhost = g_strdup(global.conf->hostname); 166 } else if (getsockname(irc->fd, (struct sockaddr*) &sock, &socklen) == 0) { 167 myhost = reverse_lookup((struct sockaddr*) &sock, socklen); 168 } 169 170 if (remote_addrlen > 0) { 171 host = reverse_lookup(remote_addr, remote_addrlen); 172 } else if (getpeername(irc->fd, (struct sockaddr*) &sock, &socklen) == 0) { 173 host = reverse_lookup((struct sockaddr*) &sock, socklen); 174 } 175 176 if (myhost == NULL) { 177 myhost = g_strdup("localhost.localdomain"); 178 } 179 if (host == NULL) { 180 host = g_strdup("localhost.localdomain"); 181 } 182 183 if (irc->root->host != irc->root->nick) { 184 g_free(irc->root->host); 185 } 186 irc->root->host = g_strdup(myhost); 187 if ((iu = irc_user_by_name(irc, NS_NICK))) { 188 if (iu->host != iu->nick) { 189 g_free(iu->host); 190 } 191 iu->host = g_strdup(myhost); 192 } 193 194 if (irc->user->host != irc->user->nick) { 195 g_free(irc->user->host); 196 } 197 irc->user->host = g_strdup(host); 198 199 g_free(myhost); 200 g_free(host); 187 201 } 188 202 -
irc.h
r3f44e43 r7a9d968 26 26 #ifndef _IRC_H 27 27 #define _IRC_H 28 29 #include <sys/socket.h> 28 30 29 31 #define IRC_MAX_LINE 512 … … 271 273 272 274 irc_t *irc_new(int fd); 275 void irc_set_hosts(irc_t *irc, const struct sockaddr *remote_addr, const socklen_t remote_addrlen); 273 276 void irc_abort(irc_t *irc, int immed, char *format, ...) G_GNUC_PRINTF(3, 4); 274 277 void irc_free(irc_t *irc); -
irc_channel.c
r3f44e43 r7a9d968 638 638 irc_channel_name_strip(name); 639 639 640 if (set_getbool(&irc->b->set, " lcnicks")) {640 if (set_getbool(&irc->b->set, "nick_lowercase")) { 641 641 nick_lc(irc, name + 1); 642 642 } -
irc_commands.c
r3f44e43 r7a9d968 26 26 #define BITLBEE_CORE 27 27 #include "bitlbee.h" 28 #include "canohost.h" 28 29 #include "help.h" 29 30 #include "ipc.h" … … 57 58 irc_check_login(irc); 58 59 } 60 } 61 62 /* http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt 63 64 This isn't actually IRC, it's used by for example stunnel4 to indicate 65 the origin of the secured counterpart of the connection. It'll go wrong 66 with arguments starting with : like for example "::1" but I guess I'm 67 okay with that. */ 68 static void irc_cmd_proxy(irc_t *irc, char **cmd) 69 { 70 struct addrinfo hints, *ai; 71 struct sockaddr_storage sock; 72 socklen_t socklen = sizeof(sock); 73 74 if (getpeername(irc->fd, (struct sockaddr*) &sock, &socklen) != 0) { 75 return; 76 } 77 78 ipv64_normalise_mapped(&sock, &socklen); 79 80 /* Only accept PROXY "command" on localhost sockets. */ 81 if (!((sock.ss_family == AF_INET && 82 ntohl(((struct sockaddr_in*)&sock)->sin_addr.s_addr) == INADDR_LOOPBACK) || 83 (sock.ss_family == AF_INET6 && 84 IN6_IS_ADDR_LOOPBACK(&((struct sockaddr_in6*)&sock)->sin6_addr)))) { 85 return; 86 } 87 88 /* And only once. Do this with a pretty dumb regex-match for 89 now, maybe better to use some sort of flag.. */ 90 if (!g_regex_match_simple("^(ip6-)?localhost(.(localdomain.?)?)?$", irc->user->host, 0, 0)) { 91 return; 92 } 93 94 memset(&hints, 0, sizeof(hints)); 95 hints.ai_flags = AI_NUMERICHOST; 96 if (getaddrinfo(cmd[2], NULL, &hints, &ai) != 0) { 97 return; 98 } 99 100 irc_set_hosts(irc, ai->ai_addr, ai->ai_addrlen); 101 freeaddrinfo(ai); 59 102 } 60 103 … … 808 851 { "cap", 1, irc_cmd_cap, 0 }, 809 852 { "pass", 1, irc_cmd_pass, 0 }, 853 { "proxy", 5, irc_cmd_proxy, IRC_CMD_PRE_LOGIN }, 810 854 { "user", 4, irc_cmd_user, IRC_CMD_PRE_LOGIN }, 811 855 { "nick", 1, irc_cmd_nick, 0 }, -
irc_im.c
r3f44e43 r7a9d968 89 89 90 90 if (bu->flags & BEE_USER_LOCAL) { 91 char *s = set_getstr(&bee->set, "handle_unknown"); 92 93 if (strcmp(s, "add_private") == 0) { 91 char *s = set_getstr(&bu->ic->acc->set, "handle_unknown") ? : 92 set_getstr(&bee->set, "handle_unknown"); 93 94 if (g_strcasecmp(s, "add_private") == 0) { 94 95 iu->last_channel = NULL; 95 } else if ( strcmp(s, "add_channel") == 0) {96 } else if (g_strcasecmp(s, "add_channel") == 0) { 96 97 iu->last_channel = irc->default_channel; 97 98 } … … 634 635 } 635 636 636 if (ic->flags & IRC_CHANNEL_JOINED) {637 irc_channel_printf(ic, "Cleaning up channel, bye!");638 }639 640 637 ic->data = NULL; 641 638 c->ui_data = NULL; -
lib/Makefile
r3f44e43 r7a9d968 13 13 14 14 # [SH] Program variables 15 objects = arc.o base64.o $(EVENT_HANDLER) ftutil.o http_client.o ini.o md5.o misc.o oauth.o oauth2.o parson.o proxy.o sha1.o $(SSL_CLIENT) url.o xmltree.o ns_parse.o15 objects = arc.o base64.o canohost.o $(EVENT_HANDLER) ftutil.o http_client.o ini.o md5.o misc.o oauth.o oauth2.o parson.o proxy.o sha1.o $(SSL_CLIENT) url.o xmltree.o ns_parse.o 16 16 17 17 LFLAGS += -r … … 36 36 lib.o: $(objects) $(subdirs) 37 37 @echo '*' Linking lib.o 38 @$(LD) $(LFLAGS) $(objects) -o lib.o38 $(VERBOSE) $(LD) $(LFLAGS) $(objects) -o lib.o 39 39 40 40 $(objects): ../Makefile.settings Makefile … … 42 42 $(objects): %.o: $(_SRCDIR_)%.c 43 43 @echo '*' Compiling $< 44 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@44 $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 45 45 46 46 -include .depend/*.d -
lib/ftutil.c
r3f44e43 r7a9d968 42 42 struct addrinfo hints, *rp; 43 43 socklen_t ssize = sizeof(struct sockaddr_storage); 44 struct sockaddr_storage saddrs , *saddr = &saddrs;44 struct sockaddr_storage saddrs = {0}, *saddr = &saddrs; 45 45 static char errmsg[1024]; 46 46 char *ftlisten = global.conf->ft_listen; … … 63 63 if (for_bitlbee_client) { 64 64 *scolon = '\0'; 65 strncpy(host, ftlisten, HOST_NAME_MAX);65 strncpy(host, ftlisten, NI_MAXHOST); 66 66 *scolon = ';'; 67 67 } else { 68 strncpy(host, scolon + 1, HOST_NAME_MAX);68 strncpy(host, scolon + 1, NI_MAXHOST); 69 69 } 70 70 } else { 71 strncpy(host, ftlisten, HOST_NAME_MAX);71 strncpy(host, ftlisten, NI_MAXHOST); 72 72 } 73 73 … … 78 78 } else if (copy_fd >= 0 && getsockname(copy_fd, (struct sockaddr*) &saddrs, &ssize) == 0 && 79 79 (saddrs.ss_family == AF_INET || saddrs.ss_family == AF_INET6) && 80 getnameinfo((struct sockaddr*) &saddrs, ssize, host, HOST_NAME_MAX,80 getnameinfo((struct sockaddr*) &saddrs, ssize, host, NI_MAXHOST, 81 81 NULL, 0, NI_NUMERICHOST) == 0) { 82 82 /* We just took our local address on copy_fd, which is likely to be a … … 84 84 most sensible we can get easily. */ 85 85 } else { 86 ASSERTSOCKOP(gethostname(host, HOST_NAME_MAX + 1), "gethostname()");86 ASSERTSOCKOP(gethostname(host, NI_MAXHOST), "gethostname()"); 87 87 } 88 88 … … 109 109 ( void * ) &(( struct sockaddr_in * ) saddr)->sin_addr.s_addr : 110 110 ( void * ) &(( struct sockaddr_in6 * ) saddr)->sin6_addr.s6_addr, 111 host, HOST_NAME_MAX)) {111 host, NI_MAXHOST)) { 112 112 strcpy(errmsg, "inet_ntop failed on listening socket"); 113 113 return -1; … … 128 128 129 129 /* I hate static-length strings.. */ 130 host[ HOST_NAME_MAX- 1] = '\0';130 host[NI_MAXHOST - 1] = '\0'; 131 131 port[5] = '\0'; 132 132 -
lib/ftutil.h
r3f44e43 r7a9d968 26 26 #endif 27 27 28 /* Some ifdefs for ulibc and apparently also BSD (Thanks to Whoopie) */29 #ifndef HOST_NAME_MAX30 #include <sys/param.h>31 #ifdef MAXHOSTNAMELEN32 #define HOST_NAME_MAX MAXHOSTNAMELEN33 #else34 #define HOST_NAME_MAX 25535 #endif36 #endif37 38 28 /* This function should be used with care. host should be AT LEAST a 39 char[ HOST_NAME_MAX+1] and port AT LEAST a char[6]. */29 char[NI_MAXHOST+1] and port AT LEAST a char[6]. */ 40 30 int ft_listen(struct sockaddr_storage *saddr_ptr, char *host, char *port, int copy_fd, int for_bitlbee_client, 41 31 char **errptr); -
lib/misc.c
r3f44e43 r7a9d968 1 /********************************************************************\1 /********************************************************************\ 2 2 * BitlBee -- An IRC to other IM-networks gateway * 3 3 * * … … 335 335 } 336 336 337 /* Wrap an IPv4 address into IPv6 space. Not thread-safe... */338 char *ipv6_wrap(char *src)339 {340 static char dst[64];341 int i;342 343 for (i = 0; src[i]; i++) {344 if ((src[i] < '0' || src[i] > '9') && src[i] != '.') {345 break;346 }347 }348 349 /* Hmm, it's not even an IP... */350 if (src[i]) {351 return src;352 }353 354 g_snprintf(dst, sizeof(dst), "::ffff:%s", src);355 356 return dst;357 }358 359 /* Unwrap an IPv4 address into IPv6 space. Thread-safe, because it's very simple. :-) */360 char *ipv6_unwrap(char *src)361 {362 int i;363 364 if (g_strncasecmp(src, "::ffff:", 7) != 0) {365 return src;366 }367 368 for (i = 7; src[i]; i++) {369 if ((src[i] < '0' || src[i] > '9') && src[i] != '.') {370 break;371 }372 }373 374 /* Hmm, it's not even an IP... */375 if (src[i]) {376 return src;377 }378 379 return (src + 7);380 }381 382 337 /* Convert from one charset to another. 383 338 -
lib/misc.h
r3f44e43 r7a9d968 29 29 #include <gmodule.h> 30 30 #include <time.h> 31 #include <sys/socket.h> 31 32 32 33 struct ns_srv_reply { … … 130 131 G_MODULE_EXPORT void http_encode(char *s); 131 132 132 G_MODULE_EXPORT char *ipv6_wrap(char *src);133 G_MODULE_EXPORT char *ipv6_unwrap(char *src);134 135 133 G_MODULE_EXPORT signed int do_iconv(char *from_cs, char *to_cs, char *src, char *dst, size_t size, size_t maxbuf); 136 134 -
nick.c
r3f44e43 r7a9d968 94 94 95 95 nick_strip(irc, nick); 96 if (set_getbool(&bu->bee->set, " lcnicks")) {96 if (set_getbool(&bu->bee->set, "nick_lowercase")) { 97 97 nick_lc(irc, nick); 98 98 } … … 215 215 if (ok && rets && *rets) { 216 216 nick_strip(irc, rets); 217 218 if (set_getbool(&bu->bee->set, "nick_lowercase")) { 219 nick_lc(irc, rets); 220 } 221 217 222 truncate_utf8(rets, MAX_NICK_LENGTH); 218 223 return rets; … … 288 293 { 289 294 int len = 0; 295 gboolean nick_underscores = irc ? set_getbool(&irc->b->set, "nick_underscores") : FALSE; 290 296 291 297 if (irc && (irc->status & IRC_UTF8_NICKS)) { … … 297 303 n = g_utf8_find_next_char(p, NULL); 298 304 299 if ((c < 0x7f && !(strchr(nick_lc_chars, c) || 300 strchr(nick_uc_chars, c))) || 305 if (nick_underscores && c == ' ') { 306 *p = '_'; 307 p = n; 308 } else if ((c < 0x7f && !(strchr(nick_lc_chars, c) || 309 strchr(nick_uc_chars, c))) || 301 310 !g_unichar_isgraph(c)) { 302 311 strcpy(tmp, n); … … 313 322 314 323 for (i = len = 0; nick[i] && len < MAX_NICK_LENGTH; i++) { 315 if (strchr(nick_lc_chars, nick[i]) || 324 if (nick_underscores && nick[i] == ' ') { 325 nick[len] = '_'; 326 len++; 327 } else if (strchr(nick_lc_chars, nick[i]) || 316 328 strchr(nick_uc_chars, nick[i])) { 317 329 nick[len] = nick[i]; -
otr.c
r3f44e43 r7a9d968 878 878 case OTRL_SMPEVENT_ASK_FOR_SECRET: 879 879 irc_rootmsg(irc, "smp: initiated by %s" 880 " - respond with \x02otr smp %s <secret>\x02",880 " - respond with \x02otr smp %s \"<secret>\"\x02", 881 881 u->nick, u->nick); 882 882 break; … … 884 884 irc_rootmsg(irc, "smp: initiated by %s with question: \x02\"%s\"\x02", u->nick, 885 885 question); 886 irc_rootmsg(irc, "smp: respond with \x02otr smp %s <answer>\x02",886 irc_rootmsg(irc, "smp: respond with \x02otr smp %s \"<answer>\"\x02", 887 887 u->nick); 888 888 break; … … 1514 1514 } 1515 1515 } 1516 assert(l != NULL); /* a match should always be found */1516 g_return_val_if_fail(l, NULL); 1517 1517 if (!l) { 1518 1518 return NULL; -
protocols/Makefile
r3f44e43 r7a9d968 43 43 44 44 $(subdirs): 45 @$(MAKE) -C $@ $(MAKECMDGOALS)45 $(MAKE) -C $@ $(MAKECMDGOALS) 46 46 47 47 ### MAIN PROGRAM … … 49 49 protocols.o: $(objects) $(subdirs) 50 50 @echo '*' Linking protocols.o 51 @$(LD) $(LFLAGS) $(objects) $(subdirobjs) -o protocols.o51 $(VERBOSE) $(LD) $(LFLAGS) $(objects) $(subdirobjs) -o protocols.o 52 52 53 53 $(objects): ../Makefile.settings Makefile … … 55 55 $(objects): %.o: $(_SRCDIR_)%.c 56 56 @echo '*' Compiling $< 57 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@57 $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 58 58 59 59 -include .depend/*.d -
protocols/account.c
r3f44e43 r7a9d968 55 55 56 56 s = set_add(&a->set, "auto_reconnect", "true", set_eval_bool, a); 57 58 s = set_add(&a->set, "handle_unknown", NULL, NULL, a); 59 s->flags |= SET_NULL_OK; 57 60 58 61 s = set_add(&a->set, "nick_format", NULL, NULL, a); -
protocols/bee_user.c
r3f44e43 r7a9d968 170 170 171 171 if (!(bu = bee_user_by_handle(bee, ic, handle))) { 172 if (g_strcasecmp(set_getstr(&ic->bee->set, "handle_unknown"), "add") == 0) { 172 char *h = set_getstr(&ic->acc->set, "handle_unknown") ? : 173 set_getstr(&ic->bee->set, "handle_unknown"); 174 175 if (g_strncasecmp(h, "add", 3) == 0) { 173 176 bu = bee_user_new(bee, ic, handle, BEE_USER_LOCAL); 174 177 } else { 175 if (g_strcasecmp( set_getstr(&ic->bee->set, "handle_unknown"), "ignore") != 0) {178 if (g_strcasecmp(h, "ignore") != 0) { 176 179 imcb_log(ic, "imcb_buddy_status() for unknown handle %s:\n" 177 180 "flags = %d, state = %s, message = %s", handle, flags, … … 255 258 256 259 if (!bu && !(ic->flags & OPT_LOGGING_OUT)) { 257 char *h = set_getstr(&bee->set, "handle_unknown"); 260 char *h = set_getstr(&ic->acc->set, "handle_unknown") ? : 261 set_getstr(&ic->bee->set, "handle_unknown"); 258 262 259 263 if (g_strcasecmp(h, "ignore") == 0) { -
protocols/jabber/Makefile
r3f44e43 r7a9d968 38 38 $(objects): %.o: $(_SRCDIR_)%.c 39 39 @echo '*' Compiling $< 40 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@40 $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 41 41 42 42 jabber_mod.o: $(objects) 43 43 @echo '*' Linking jabber_mod.o 44 @$(LD) $(LFLAGS) $(objects) -o jabber_mod.o44 $(VERBOSE) $(LD) $(LFLAGS) $(objects) -o jabber_mod.o 45 45 46 46 -include .depend/*.d -
protocols/jabber/conference.c
r3f44e43 r7a9d968 167 167 jabber_buddy_remove_bare(c->ic, jc->name); 168 168 169 g_free(jc->last_sent_message); 169 170 g_free(jc->my_full_jid); 170 171 g_free(jc->name); … … 187 188 188 189 jabber_cache_add(ic, node, jabber_chat_self_message); 190 191 g_free(jc->last_sent_message); 192 jc->last_sent_message = g_strdup(message); 189 193 190 194 return !jabber_write_packet(ic, node); … … 325 329 } 326 330 bud->flags |= JBFLAG_IS_ANONYMOUS; 331 } else if (bud == jc->me) { 332 g_free(bud->ext_jid); 333 bud->ext_jid = g_strdup(jd->me); 327 334 } 328 335 … … 347 354 } 348 355 356 imcb_chat_add_buddy(chat, bud->ext_jid); 357 349 358 if (bud != jc->me && (jc->flags & JCFLAG_ALWAYS_USE_NICKS) && !(bud->flags & JBFLAG_IS_ANONYMOUS)) { 350 359 imcb_buddy_nick_change(ic, bud->ext_jid, bud->resource); 351 360 } 352 361 353 imcb_chat_add_buddy(chat, bud->ext_jid);354 362 if (s) { 355 363 *s = '/'; … … 494 502 imcb_chat_log(chat, "From conference server: %s", body->text); 495 503 return; 496 } else if (jc && jc->flags & JCFLAG_MESSAGE_SENT && bud == jc->me && 497 (jabber_cache_handle_packet(ic, node) == XT_ABORT)) { 498 /* Self message marked by this bitlbee, don't show it */ 499 return; 504 } else if (jc && jc->flags & JCFLAG_MESSAGE_SENT && bud == jc->me) { 505 if (jabber_cache_handle_packet(ic, node) == XT_ABORT) { 506 /* Self message marked by this bitlbee, don't show it */ 507 return; 508 } else if (xt_find_attr(node, "id") == NULL && 509 g_strcmp0(body->text, jc->last_sent_message) == 0) { 510 /* Some misbehaving servers (like slack) eat the ids and echo anyway. 511 * Try to detect those cases by comparing against the last sent message. */ 512 return; 513 } 500 514 } 501 515 -
protocols/jabber/jabber.h
r3f44e43 r7a9d968 161 161 struct jabber_buddy *me; 162 162 char *invite; 163 char *last_sent_message; 163 164 }; 164 165 -
protocols/jabber/s5bytestream.c
r3f44e43 r7a9d968 500 500 case BS_PHASE_REPLY: 501 501 { 502 struct socks5_message socks5_reply ;502 struct socks5_message socks5_reply = {0}; 503 503 int ret; 504 504 … … 888 888 char *proxy, *next, *errmsg = NULL; 889 889 char port[6]; 890 char host[ HOST_NAME_MAX+ 1];890 char host[NI_MAXHOST + 1]; 891 891 jabber_streamhost_t *sh, *sh2; 892 892 GSList *streamhosts = jd->streamhosts; … … 1046 1046 unsigned char nmethods; 1047 1047 unsigned char method; 1048 } socks5_hello ;1048 } socks5_hello = {0}; 1049 1049 1050 1050 if (!(ret = jabber_bs_peek(bt, &socks5_hello, sizeof(socks5_hello)))) { … … 1091 1091 case BS_PHASE_REQUEST: 1092 1092 { 1093 struct socks5_message socks5_connect ;1093 struct socks5_message socks5_connect = {0}; 1094 1094 int msgsize = sizeof(struct socks5_message); 1095 1095 int ret; -
protocols/msn/Makefile
r3f44e43 r7a9d968 38 38 $(objects): %.o: $(_SRCDIR_)%.c 39 39 @echo '*' Compiling $< 40 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@40 $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 41 41 42 42 msn_mod.o: $(objects) 43 43 @echo '*' Linking msn_mod.o 44 @$(LD) $(LFLAGS) $(objects) -o msn_mod.o44 $(VERBOSE) $(LD) $(LFLAGS) $(objects) -o msn_mod.o 45 45 46 46 -include .depend/*.d -
protocols/msn/msn_util.c
r3f44e43 r7a9d968 180 180 if (getenv("BITLBEE_DEBUG")) { 181 181 fprintf(stderr, "\n\x1b[92m<<< "); 182 write(2, bytes , st);182 fwrite(bytes, st, 1, stderr); 183 183 fprintf(stderr, "\x1b[97m"); 184 184 } -
protocols/msn/soap.c
r3f44e43 r7a9d968 213 213 if (headers) { 214 214 if ((s = strstr(headers, "\r\n\r\n"))) { 215 write(2, headers, s - headers + 4);215 fwrite(headers, s - headers + 4, 1, stderr); 216 216 } else { 217 write(2, headers, strlen(headers));217 fwrite(headers, strlen(headers), 1, stderr); 218 218 } 219 219 } -
protocols/nogaim.c
r3f44e43 r7a9d968 50 50 } 51 51 52 /* semi-private */ 53 gboolean plugin_info_validate(struct plugin_info *info, const char *path) 54 { 55 GList *l; 56 gboolean loaded = FALSE; 57 58 if (!path) { 59 path = "(null)"; 60 } 61 62 if (info->abiver != BITLBEE_ABI_VERSION_CODE) { 63 log_message(LOGLVL_ERROR, 64 "`%s' uses ABI %u but %u is required\n", 65 path, info->abiver, 66 BITLBEE_ABI_VERSION_CODE); 67 return FALSE; 68 } 69 70 if (!info->name || !info->version) { 71 log_message(LOGLVL_ERROR, 72 "Name or version missing from the " 73 "plugin info in `%s'\n", path); 74 return FALSE; 75 } 76 77 for (l = plugins; l; l = l->next) { 78 struct plugin_info *i = l->data; 79 80 if (g_strcasecmp(i->name, info->name) == 0) { 81 loaded = TRUE; 82 break; 83 } 84 } 85 86 if (loaded) { 87 log_message(LOGLVL_WARNING, 88 "%s plugin already loaded\n", 89 info->name); 90 return FALSE; 91 } 92 93 return TRUE; 94 } 95 96 /* semi-private */ 97 gboolean plugin_info_add(struct plugin_info *info) 98 { 99 plugins = g_list_insert_sorted_with_data(plugins, info, pluginscmp, NULL); 100 return TRUE; 101 } 102 52 103 gboolean load_plugin(char *path) 53 104 { 54 GList *l; 55 struct plugin_info *i; 56 struct plugin_info *info; 105 struct plugin_info *info = NULL; 57 106 struct plugin_info * (*info_function) (void) = NULL; 58 107 void (*init_function) (void); 59 108 60 109 GModule *mod = g_module_open(path, G_MODULE_BIND_LAZY); 61 gboolean loaded = FALSE;62 110 63 111 if (!mod) { … … 69 117 info = info_function(); 70 118 71 if (info->abiver != BITLBEE_ABI_VERSION_CODE) { 72 log_message(LOGLVL_ERROR, 73 "`%s' uses ABI %u but %u is required\n", 74 path, info->abiver, 75 BITLBEE_ABI_VERSION_CODE); 76 g_module_close(mod); 77 return FALSE; 78 } 79 80 if (!info->name || !info->version) { 81 log_message(LOGLVL_ERROR, 82 "Name or version missing from the " 83 "plugin info in `%s'\n", path); 84 g_module_close(mod); 85 return FALSE; 86 } 87 88 for (l = plugins; l; l = l->next) { 89 i = l->data; 90 91 if (g_strcasecmp(i->name, info->name) == 0) { 92 loaded = TRUE; 93 break; 94 } 95 } 96 97 if (loaded) { 98 log_message(LOGLVL_WARNING, 99 "%s plugin already loaded\n", 100 info->name); 119 if (!plugin_info_validate(info, path)) { 101 120 g_module_close(mod); 102 121 return FALSE; … … 113 132 114 133 if (info_function) { 115 plugins = g_list_insert_sorted_with_data(plugins, info, 116 pluginscmp, NULL); 134 plugin_info_add(info); 117 135 } 118 136 … … 797 815 msg = ic->acc->flags & ACC_FLAG_AWAY_MESSAGE ? away : NULL; 798 816 away = imc_away_state_find(m, away, &msg) ? : 799 (imc_away_state_find(m, "away", &msg) ? : m->data);817 (imc_away_state_find(m, "away", NULL) ? : m->data); 800 818 } else if (ic->acc->flags & ACC_FLAG_STATUS_MESSAGE) { 801 819 away = NULL; … … 831 849 contains no data unless it adds something to what 832 850 we have in state already. */ 833 if ( strlen(m->data) == strlen(away)) {851 if (message && strlen(m->data) == strlen(away)) { 834 852 *message = NULL; 835 853 } … … 857 875 for (m = gcm; m; m = m->next) { 858 876 if (g_strcasecmp(imc_away_alias_list[i][j], m->data) == 0) { 859 if (!keep_message ) {877 if (!keep_message && message) { 860 878 *message = NULL; 861 879 } -
protocols/oscar/Makefile
r3f44e43 r7a9d968 39 39 $(objects): %.o: $(_SRCDIR_)%.c 40 40 @echo '*' Compiling $< 41 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@41 $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 42 42 43 43 oscar_mod.o: $(objects) 44 44 @echo '*' Linking oscar_mod.o 45 @$(LD) $(LFLAGS) $(objects) -o oscar_mod.o45 $(VERBOSE) $(LD) $(LFLAGS) $(objects) -o oscar_mod.o 46 46 47 47 -include .depend/*.d -
protocols/oscar/rxhandlers.c
r3f44e43 r7a9d968 235 235 struct aim_rxcblist_s *newcb; 236 236 237 if (!conn) { 238 return -1; 239 } 240 241 if (checkdisallowed(family, type)) { 242 g_assert(0); 243 return -1; 244 } 237 g_return_val_if_fail(conn, -1); 238 g_return_val_if_fail(!checkdisallowed(family, type), -1); 245 239 246 240 if (!(newcb = (struct aim_rxcblist_s *) g_new0(struct aim_rxcblist_s, 1))) { -
protocols/purple/Makefile
r3f44e43 r7a9d968 39 39 $(objects): %.o: $(_SRCDIR_)%.c 40 40 @echo '*' Compiling $< 41 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@41 $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 42 42 43 43 purple_mod.o: $(objects) 44 44 @echo '*' Linking purple_mod.o 45 @$(LD) $(LFLAGS) $(objects) -o purple_mod.o45 $(VERBOSE) $(LD) $(LFLAGS) $(objects) -o purple_mod.o 46 46 47 47 -include .depend/*.d -
protocols/purple/bpurple.h
r3f44e43 r7a9d968 6 6 7 7 #define PURPLE_REQUEST_HANDLE "purple_request" 8 9 #define PURPLE_OPT_SHOULD_SET_NICK 1 8 10 9 11 struct purple_data … … 15 17 char *chat_list_server; 16 18 GSList *filetransfers; 19 20 int flags; 17 21 }; 18 22 -
protocols/purple/ft.c
r3f44e43 r7a9d968 146 146 remove the evil cast below. */ 147 147 px->ft = imcb_file_send_start(ic, (char *) who, xfer->filename, xfer->size); 148 149 if (!px->ft) { 150 return FALSE; 151 } 148 152 px->ft->data = px; 149 153 -
protocols/purple/purple.c
r3f44e43 r7a9d968 114 114 } 115 115 116 static gboolean purple_account_should_set_nick(account_t *acc) 117 { 118 /* whitelist of protocols that tend to have numeric or meaningless usernames, and should 119 * always offer the 'alias' as a nick. this is just so that users don't have to do 120 * 'account whatever set nick_format %full_name' 121 */ 122 char *whitelist[] = { 123 "prpl-hangouts", 124 "prpl-eionrobb-funyahoo-plusplus", 125 "prpl-icq", 126 "prpl-line", 127 NULL, 128 }; 129 char **p; 130 131 for (p = whitelist; *p; p++) { 132 if (g_strcmp0(acc->prpl->data, *p) == 0) { 133 return TRUE; 134 } 135 } 136 137 return FALSE; 138 } 139 116 140 static void purple_init(account_t *acc) 117 141 { … … 281 305 } 282 306 307 if (g_strcmp0(prpl->info->id, "prpl-line") == 0) { 308 s = set_add(&acc->set, "line-auth-token", NULL, NULL, acc); 309 s->flags |= SET_HIDDEN; 310 } 311 283 312 /* Go through all away states to figure out if away/status messages 284 313 are possible. */ … … 344 373 purple_account_set_check_mail(pa, set_getbool(&acc->set, "mail_notifications")); 345 374 } 375 376 if (g_strcmp0(prpl->info->id, "prpl-line") == 0) { 377 const char *name = "line-auth-token"; 378 purple_account_set_string(pa, name, set_getstr(&acc->set, name)); 379 } 346 380 } 347 381 … … 372 406 purple_account_set_password(pd->account, acc->pass); 373 407 purple_sync_settings(acc, pd->account); 408 409 if (purple_account_should_set_nick(acc)) { 410 pd->flags = PURPLE_OPT_SHOULD_SET_NICK; 411 } 374 412 375 413 purple_account_set_enabled(pd->account, "BitlBee", TRUE); … … 741 779 struct groupchat *gc; 742 780 GList *info, *l; 781 GString *missing_settings = NULL; 743 782 744 783 if (!pi->chat_info || !pi->chat_info_defaults || … … 766 805 } else if (strcmp(pce->identifier, "passwd") == 0) { 767 806 g_hash_table_replace(chat_hash, "passwd", g_strdup(password)); 807 } else { 808 char *key, *value; 809 810 key = g_strdup_printf("purple_%s", pce->identifier); 811 str_reject_chars(key, " -", '_'); 812 813 if ((value = set_getstr(sets, key))) { 814 /* sync from bitlbee to the prpl */ 815 g_hash_table_replace(chat_hash, (char *) pce->identifier, g_strdup(value)); 816 } else if ((value = g_hash_table_lookup(chat_hash, pce->identifier))) { 817 /* if the bitlbee one was empty, sync from prpl to bitlbee */ 818 set_setstr(sets, key, value); 819 } 820 821 g_free(key); 822 } 823 824 if (pce->required && !g_hash_table_lookup(chat_hash, pce->identifier)) { 825 if (!missing_settings) { 826 missing_settings = g_string_sized_new(32); 827 } 828 g_string_append_printf(missing_settings, "%s, ", pce->identifier); 768 829 } 769 830 … … 772 833 773 834 g_list_free(info); 835 836 if (missing_settings) { 837 /* remove the ", " from the end */ 838 g_string_truncate(missing_settings, missing_settings->len - 2); 839 840 imcb_error(ic, "Can't join %s. The following settings are required: %s", room, missing_settings->str); 841 842 g_string_free(missing_settings, TRUE); 843 g_hash_table_destroy(chat_hash); 844 return NULL; 845 } 774 846 775 847 /* do this before serv_join_chat to handle cases where prplcb_conv_new is called immediately (not async) */ … … 806 878 purple_roomlist_ref(list); 807 879 } 880 } 881 882 /* handles either prpl->chat_(add|free)_settings depending on the value of 'add' */ 883 static void purple_chat_update_settings(account_t *acc, set_t **head, gboolean add) 884 { 885 PurplePlugin *prpl = purple_plugins_find_with_id((char *) acc->prpl->data); 886 PurplePluginProtocolInfo *pi = prpl->info->extra_info; 887 GList *info, *l; 888 889 if (!pi->chat_info || !pi->chat_info_defaults) { 890 return; 891 } 892 893 /* hack / leap of faith: pass a NULL here because we don't have a connection yet. 894 * i reviewed all the built-in prpls and a bunch of third-party ones and none 895 * of them seem to need this parameter at all, so... i hope it never crashes */ 896 info = pi->chat_info(NULL); 897 898 for (l = info; l; l = l->next) { 899 struct proto_chat_entry *pce = l->data; 900 char *key; 901 902 if (strcmp(pce->identifier, "handle") == 0 || 903 strcmp(pce->identifier, "password") == 0 || 904 strcmp(pce->identifier, "passwd") == 0) { 905 /* skip these, they are handled above */ 906 g_free(pce); 907 continue; 908 } 909 910 key = g_strdup_printf("purple_%s", pce->identifier); 911 str_reject_chars(key, " -", '_'); 912 913 if (add) { 914 set_add(head, key, NULL, NULL, NULL); 915 } else { 916 set_del(head, key); 917 } 918 919 g_free(key); 920 g_free(pce); 921 } 922 923 g_list_free(NULL); 924 g_list_free(info); 925 } 926 927 static void purple_chat_add_settings(account_t *acc, set_t **head) 928 { 929 purple_chat_update_settings(acc, head, TRUE); 930 } 931 932 static void purple_chat_free_settings(account_t *acc, set_t **head) 933 { 934 purple_chat_update_settings(acc, head, FALSE); 808 935 } 809 936 … … 844 971 { 845 972 struct im_connection *ic = purple_ic_by_gc(gc); 846 const char *dn; 973 struct purple_data *pd = ic->proto_data; 974 const char *dn, *token; 847 975 set_t *s; 848 976 … … 857 985 // user list needs to be requested for Gadu-Gadu 858 986 purple_gg_buddylist_import(gc); 987 988 /* more awful hacks, because clearly we didn't have enough of those */ 989 if ((s = set_find(&ic->acc->set, "line-auth-token")) && 990 (token = purple_account_get_string(pd->account, "line-auth-token", NULL))) { 991 g_free(s->value); 992 s->value = g_strdup(token); 993 } 859 994 860 995 ic->flags |= OPT_DOES_HTML; … … 908 1043 PurpleGroup *group = purple_buddy_get_group(bud); 909 1044 struct im_connection *ic = purple_ic_by_pa(bud->account); 1045 struct purple_data *pd = ic->proto_data; 910 1046 PurpleStatus *as; 911 1047 int flags = 0; 1048 char *alias = NULL; 912 1049 913 1050 if (ic == NULL) { … … 915 1052 } 916 1053 917 if (bud->server_alias) { 918 imcb_rename_buddy(ic, bud->name, bud->server_alias); 919 } else if (bud->alias) { 920 imcb_rename_buddy(ic, bud->name, bud->alias); 1054 alias = bud->server_alias ? : bud->alias; 1055 1056 if (alias) { 1057 imcb_rename_buddy(ic, bud->name, alias); 1058 if (pd->flags & PURPLE_OPT_SHOULD_SET_NICK) { 1059 imcb_buddy_nick_change(ic, bud->name, alias); 1060 } 921 1061 } 922 1062 … … 1062 1202 } 1063 1203 1064 /* Handles write_im and write_chat. Removes echoes of locally sent messages */ 1204 /* Handles write_im and write_chat. Removes echoes of locally sent messages. 1205 * 1206 * PURPLE_MESSAGE_DELAYED is used for chat backlogs - if a message has both 1207 * that flag and _SEND, it's a self-message from before joining the channel. 1208 * Those are safe to display. The rest (with just _SEND) may be echoes. */ 1065 1209 static void prplcb_conv_msg(PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, time_t mtime) 1066 1210 { 1067 if ( !(flags & PURPLE_MESSAGE_SEND)) {1068 handle_conv_msg(conv, who, message, 0, mtime);1211 if ((!(flags & PURPLE_MESSAGE_SEND)) || (flags & PURPLE_MESSAGE_DELAYED)) { 1212 handle_conv_msg(conv, who, message, (flags & PURPLE_MESSAGE_SEND) ? OPT_SELFMESSAGE : 0, mtime); 1069 1213 } 1070 1214 } … … 1392 1536 } 1393 1537 1538 static char *prplcb_roomlist_get_room_name(PurpleRoomlist *list, PurpleRoomlistRoom *room) 1539 { 1540 struct im_connection *ic = purple_ic_by_pa(list->account); 1541 struct purple_data *pd = ic->proto_data; 1542 PurplePlugin *prpl = purple_plugins_find_with_id(pd->account->protocol_id); 1543 PurplePluginProtocolInfo *pi = prpl->info->extra_info; 1544 1545 if (pi && pi->roomlist_room_serialize) { 1546 return pi->roomlist_room_serialize(room); 1547 } else { 1548 return g_strdup(purple_roomlist_room_get_name(room)); 1549 } 1550 } 1551 1394 1552 static void prplcb_roomlist_add_room(PurpleRoomlist *list, PurpleRoomlistRoom *room) 1395 1553 { 1396 1554 bee_chat_info_t *ci; 1397 c onst char *title;1555 char *title; 1398 1556 const char *topic; 1399 1557 GList *fields; … … 1401 1559 1402 1560 fields = purple_roomlist_room_get_fields(room); 1403 title = p urple_roomlist_room_get_name(room);1561 title = prplcb_roomlist_get_room_name(list, room); 1404 1562 1405 1563 if (rld->topic >= 0) { … … 1410 1568 1411 1569 ci = g_new(bee_chat_info_t, 1); 1412 ci->title = g_strdup(title);1570 ci->title = title; 1413 1571 ci->topic = g_strdup(topic); 1414 1572 rld->chats = g_slist_prepend(rld->chats, ci); … … 1632 1790 } 1633 1791 1792 /* borrowing this semi-private function 1793 * TODO: figure out a better interface later (famous last words) */ 1794 gboolean plugin_info_add(struct plugin_info *info); 1795 1634 1796 void purple_initmodule() 1635 1797 { … … 1638 1800 GString *help; 1639 1801 char *dir; 1802 gboolean debug_enabled = !!getenv("BITLBEE_DEBUG"); 1640 1803 1641 1804 if (purple_get_core() != NULL) { … … 1645 1808 } 1646 1809 1647 g_ assert((int) B_EV_IO_READ == (int) PURPLE_INPUT_READ);1648 g_ assert((int) B_EV_IO_WRITE == (int) PURPLE_INPUT_WRITE);1810 g_return_if_fail((int) B_EV_IO_READ == (int) PURPLE_INPUT_READ); 1811 g_return_if_fail((int) B_EV_IO_WRITE == (int) PURPLE_INPUT_WRITE); 1649 1812 1650 1813 dir = g_strdup_printf("%s/purple", global.conf->configdir); … … 1656 1819 g_free(dir); 1657 1820 1658 purple_debug_set_enabled( FALSE);1821 purple_debug_set_enabled(debug_enabled); 1659 1822 purple_core_set_ui_ops(&bee_core_uiops); 1660 1823 purple_eventloop_set_ui_ops(&glib_eventloops); … … 1664 1827 abort(); 1665 1828 } 1829 purple_debug_set_enabled(FALSE); 1666 1830 1667 1831 if (proxytype != PROXY_NONE) { … … 1722 1886 funcs.chat_join = purple_chat_join; 1723 1887 funcs.chat_list = purple_chat_list; 1888 funcs.chat_add_settings = purple_chat_add_settings; 1889 funcs.chat_free_settings = purple_chat_free_settings; 1724 1890 funcs.transfer_request = purple_transfer_request; 1725 1891 … … 1732 1898 PurplePluginProtocolInfo *pi = prot->info->extra_info; 1733 1899 struct prpl *ret; 1900 struct plugin_info *info; 1734 1901 1735 1902 /* If we already have this one (as a native module), don't … … 1766 1933 register_protocol(ret); 1767 1934 } 1935 1936 info = g_new0(struct plugin_info, 1); 1937 info->abiver = BITLBEE_ABI_VERSION_CODE; 1938 info->name = ret->name; 1939 info->version = prot->info->version; 1940 info->description = prot->info->description; 1941 info->author = prot->info->author; 1942 info->url = prot->info->homepage; 1943 1944 plugin_info_add(info); 1768 1945 } 1769 1946 -
protocols/twitter/Makefile
r3f44e43 r7a9d968 38 38 $(objects): %.o: $(_SRCDIR_)%.c 39 39 @echo '*' Compiling $< 40 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@40 $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 41 41 42 42 twitter_mod.o: $(objects) 43 43 @echo '*' Linking twitter_mod.o 44 @$(LD) $(LFLAGS) $(objects) -o twitter_mod.o44 $(VERBOSE) $(LD) $(LFLAGS) $(objects) -o twitter_mod.o 45 45 46 46 -include .depend/*.d -
protocols/twitter/twitter.c
r3f44e43 r7a9d968 576 576 s->flags |= SET_HIDDEN | SET_NOSAVE; 577 577 578 s = set_add(&acc->set, "in_korea", "false", set_eval_bool, acc); 579 s->flags |= SET_HIDDEN; 580 578 581 if (strcmp(acc->prpl->name, "twitter") == 0) { 579 582 s = set_add(&acc->set, "stream", "true", set_eval_bool, acc); -
protocols/twitter/twitter_lib.c
r3f44e43 r7a9d968 239 239 if ((ret = json_parse_string(req->reply_body)) == NULL) { 240 240 imcb_error(ic, "Could not retrieve %s: %s", 241 path, " XMLparse error");241 path, "JSON parse error"); 242 242 } 243 243 return ret; … … 310 310 311 311 txl->list = g_slist_prepend(txl->list, 312 g_strdup_printf("% lld", id));312 g_strdup_printf("%" PRIu64, id); 313 313 } 314 314 … … 443 443 txl = g_new0(struct twitter_xml_list, 1); 444 444 txl->list = td->noretweets_ids; 445 445 446 446 // Process the retweet ids 447 447 txl->type = TXL_ID; … … 452 452 jint id = json_array_get_integer(arr, i); 453 453 txl->list = g_slist_prepend(txl->list, 454 g_strdup_printf("% lld", id));454 g_strdup_printf("%" PRId64, id)); 455 455 } 456 456 } … … 713 713 return; 714 714 if ((quoted = json_object_get_object(node, "quoted_status"))) { 715 /* New "retweets with comments" feature. Note that this info 716 * seems to be included in the streaming API only! Grab the 715 /* New "retweets with comments" feature. Grab the 717 716 * full message and try to insert it when we run into the 718 717 * Tweet entity. */ … … 755 754 char *pos, *new; 756 755 757 if (!kort || !disp || !(pos = strstr(*text, kort))) { 756 /* Skip if a required field is missing, if the t.co URL is not in fact 757 in the Tweet at all, or if the full-ish one *is* in it already 758 (dupes appear, especially in streaming API). */ 759 if (!kort || !disp || !(pos = strstr(*text, kort)) || strstr(*text, disp)) { 758 760 continue; 759 761 } … … 980 982 return; 981 983 } 982 984 983 985 /* Check this is not a tweet that should be muted */ 984 986 uid_str = g_strdup_printf("%" G_GUINT64_FORMAT, status->user->uid); … … 1691 1693 }; 1692 1694 1695 if (set_getbool(&ic->acc->set, "in_korea") && !in_reply_to) { 1696 g_free(args[3]); 1697 args[2] = "place_id"; 1698 args[3] = g_strdup("c999e6a453e9ef72"); 1699 in_reply_to = 1; 1700 } 1701 1693 1702 twitter_http(ic, TWITTER_STATUS_UPDATE_URL, twitter_http_post, ic, 1, 1694 1703 args, in_reply_to ? 4 : 2); -
root_commands.c
r3f44e43 r7a9d968 1072 1072 format = "%s\t%s\t%s"; 1073 1073 } else { 1074 format = "%- 16.16s %-40.40s %s";1074 format = "%-24.24s %-40.40s %s"; 1075 1075 } 1076 1076 … … 1172 1172 } 1173 1173 1174 static void cmd_plugins_info(irc_t *irc, char **cmd) 1175 { 1176 GList *l; 1177 struct plugin_info *info; 1178 1179 MIN_ARGS(2); 1180 1181 for (l = get_plugins(); l; l = l->next) { 1182 info = l->data; 1183 if (g_strcasecmp(cmd[2], info->name) == 0) { 1184 break; 1185 } 1186 } 1187 1188 if (!l) { 1189 return; 1190 } 1191 1192 irc_rootmsg(irc, "%s:", info->name); 1193 irc_rootmsg(irc, " Version: %s", info->version); 1194 1195 if (info->description) { 1196 irc_rootmsg(irc, " Description: %s", info->description); 1197 } 1198 1199 if (info->author) { 1200 irc_rootmsg(irc, " Author: %s", info->author); 1201 } 1202 1203 if (info->url) { 1204 irc_rootmsg(irc, " URL: %s", info->url); 1205 } 1206 } 1207 1174 1208 static void cmd_plugins(irc_t *irc, char **cmd) 1175 1209 { 1176 1210 GList *prpls; 1177 1211 GString *gstr; 1212 1213 if (cmd[1] && g_strcasecmp(cmd[1], "info") == 0) { 1214 cmd_plugins_info(irc, cmd); 1215 return; 1216 } 1178 1217 1179 1218 #ifdef WITH_PLUGINS 1180 1219 GList *l; 1181 1220 struct plugin_info *info; 1221 char *format; 1222 1223 if (strchr(irc->umode, 'b') != NULL) { 1224 format = "%s\t%s"; 1225 } else { 1226 format = "%-30s %s"; 1227 } 1228 1229 irc_rootmsg(irc, format, "Plugin", "Version"); 1182 1230 1183 1231 for (l = get_plugins(); l; l = l->next) { 1232 char *c; 1184 1233 info = l->data; 1185 irc_rootmsg(irc, "%s:", info->name); 1186 irc_rootmsg(irc, " Version: %s", info->version); 1187 1188 if (info->description) { 1189 irc_rootmsg(irc, " Description: %s", info->description); 1190 } 1191 1192 if (info->author) { 1193 irc_rootmsg(irc, " Author: %s", info->author); 1194 } 1195 1196 if (info->url) { 1197 irc_rootmsg(irc, " URL: %s", info->url); 1198 } 1199 1200 irc_rootmsg(irc, ""); 1234 1235 /* some purple plugins like to include several versions separated by newlines... */ 1236 if ((c = strchr(info->version, '\n'))) { 1237 char *version = g_strndup(info->version, c - info->version); 1238 irc_rootmsg(irc, format, info->name, version); 1239 g_free(version); 1240 } else { 1241 irc_rootmsg(irc, format, info->name, info->version); 1242 } 1201 1243 } 1202 1244 #endif 1245 1246 irc_rootmsg(irc, ""); 1203 1247 1204 1248 gstr = g_string_new(NULL); … … 1346 1390 } else if (g_strcasecmp(cmd[1], "set") == 0 || 1347 1391 g_strcasecmp(cmd[1], "del") == 0) { 1348 irc_rootmsg(irc, 1349 "Warning: The \002chat\002 command was mostly replaced with the \002channel\002 command."); 1350 cmd_channel(irc, cmd); 1392 irc_rootmsg(irc, "Unknown command: chat %s. Did you mean \002channel %s\002?", cmd[1], cmd[1]); 1351 1393 } else { 1352 1394 irc_rootmsg(irc, … … 1406 1448 topic = ci->topic ? ci->topic : ""; 1407 1449 1408 padded = str_pad_and_truncate(ci->title , title_len, "[...]");1450 padded = str_pad_and_truncate(ci->title ? ci->title : "", title_len, "[...]"); 1409 1451 irc_rootmsg(irc, iformat, ++i, padded, topic); 1410 1452 g_free(padded); -
set.c
r3f44e43 r7a9d968 165 165 /* If there's a default setting and it's equal to what we're trying to 166 166 set, stick with s->value = NULL. Otherwise, remember the setting. */ 167 if (!s->def || ( strcmp(nv, s->def) != 0)) {167 if (!s->def || (g_strcmp0(nv, s->def) != 0)) { 168 168 s->value = g_strdup(nv); 169 169 } -
storage.c
r3f44e43 r7a9d968 74 74 75 75 storage = storage_init_single(primary); 76 if (storage == NULL &&storage->save == NULL) {76 if (storage == NULL || storage->save == NULL) { 77 77 return NULL; 78 78 } -
storage_xml.c
r3f44e43 r7a9d968 290 290 } 291 291 292 handle_settings(node, &xd->irc->b->set); 293 292 294 if (xt_handle(xp, NULL, 1) == XT_HANDLED) { 293 295 ret = STORAGE_OK; 294 296 } 295 296 handle_settings(node, &xd->irc->b->set);297 297 298 298 error: -
tests/Makefile
r3f44e43 r7a9d968 21 21 check: $(test_objs) $(addprefix ../, $(main_objs)) ../protocols/protocols.o ../lib/lib.o 22 22 @echo '*' Linking $@ 23 @$(CC) $(CFLAGS) -o $@ $^ $(LFLAGS) $(EFLAGS)23 $(VERBOSE) $(CC) $(CFLAGS) -o $@ $^ $(LFLAGS) $(EFLAGS) 24 24 25 25 %.o: $(_SRCDIR_)%.c 26 26 @echo '*' Compiling $< 27 @$(CC) -c $(CFLAGS) $< -o $@27 $(VERBOSE) $(CC) -c $(CFLAGS) $< -o $@ -
tests/check.c
r3f44e43 r7a9d968 14 14 int sock[2]; 15 15 16 if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNIX, sock) < 0) {16 if (socketpair(AF_UNIX, SOCK_STREAM, 0, sock) < 0) { 17 17 perror("socketpair"); 18 18 return FALSE; -
tests/check_jabber_util.c
r3f44e43 r7a9d968 37 37 fail_unless(jabber_buddy_by_jid(ic, "wilmer@GAAST.NET/BitlBee", GET_BUDDY_CREAT) == budw1); 38 38 39 fail_unless(jabber_buddy_by_jid(ic, "wilmer@gaast.net", GET_BUDDY_EXACT) );39 fail_unless(jabber_buddy_by_jid(ic, "wilmer@gaast.net", GET_BUDDY_EXACT) != NULL); 40 40 fail_unless(jabber_buddy_by_jid(ic, "WILMER@gaast.net", 0) == budw3); 41 41 … … 83 83 fail_if(jabber_buddy_remove(ic, "nekkid@lamejab.net/Illegal")); 84 84 fail_unless(jabber_buddy_remove(ic, "nekkid@lamejab.net")); 85 fail_if(jabber_buddy_by_jid(ic, "nekkid@lamejab.net", 0) );85 fail_if(jabber_buddy_by_jid(ic, "nekkid@lamejab.net", 0) != NULL); 86 86 87 87 /* Fixing a bug in this branch that caused information to get lost when -
unix.c
r3f44e43 r7a9d968 147 147 struct passwd *pw = NULL; 148 148 pw = getpwnam(global.conf->user); 149 if (pw) { 150 initgroups(global.conf->user, pw->pw_gid); 151 setgid(pw->pw_gid); 152 setuid(pw->pw_uid); 153 } else { 154 log_message(LOGLVL_WARNING, "Failed to look up user %s.", global.conf->user); 149 if (!pw) { 150 log_message(LOGLVL_ERROR, "Failed to look up user %s.", global.conf->user); 151 152 } else if (initgroups(global.conf->user, pw->pw_gid) != 0) { 153 log_message(LOGLVL_ERROR, "initgroups: %s.", strerror(errno)); 154 155 } else if (setgid(pw->pw_gid) != 0) { 156 log_message(LOGLVL_ERROR, "setgid(%d): %s.", pw->pw_gid, strerror(errno)); 157 158 } else if (setuid(pw->pw_uid) != 0) { 159 log_message(LOGLVL_ERROR, "setuid(%d): %s.", pw->pw_uid, strerror(errno)); 155 160 } 156 161 } … … 281 286 static void sighandler_shutdown(int signal) 282 287 { 288 int unused G_GNUC_UNUSED; 283 289 /* Write a single null byte to the pipe, just to send a message to the main loop. 284 290 * This gets handled by bitlbee_shutdown (the b_input_add callback for this pipe) */ 285 write(shutdown_pipe.fd[1], "", 1);291 unused = write(shutdown_pipe.fd[1], "", 1); 286 292 } 287 293 … … 292 298 { 293 299 GSList *l; 300 int unused G_GNUC_UNUSED; 294 301 const char *message = "ERROR :BitlBee crashed! (SIGSEGV received)\r\n"; 295 302 int len = strlen(message); … … 298 305 irc_t *irc = l->data; 299 306 sock_make_blocking(irc->fd); 300 write(irc->fd, message, len);307 unused = write(irc->fd, message, len); 301 308 } 302 309
Note: See TracChangeset
for help on using the changeset viewer.