Changes in / [7a9d968:3f44e43]
- Files:
-
- 17 added
- 5 deleted
- 67 edited
Legend:
- Unmodified
- Added
- Removed
-
.travis.yml
r7a9d968 r3f44e43 1 dist: precise1 sudo: false 2 2 language: c 3 3 … … 31 31 - libpam0g-dev 32 32 - libldap2-dev 33 - fakeroot34 - debhelper35 - devscripts36 33 coverity_scan: 37 34 project: -
Makefile
r7a9d968 r3f44e43 94 94 mkdir -p $(DESTDIR)$(SBINDIR) 95 95 $(INSTALL) -m 0755 $(OUTFILE) $(DESTDIR)$(SBINDIR)/$(OUTFILE) 96 ifdef IMPLIB97 # import library for cygwin98 mkdir -p $(DESTDIR)$(LIBDIR)99 $(INSTALL) -m 0644 $(IMPLIB) $(DESTDIR)$(LIBDIR)/$(IMPLIB)100 endif101 96 102 97 uninstall-bin: 103 98 rm -f $(DESTDIR)$(SBINDIR)/$(OUTFILE) 104 ifdef IMPLIB105 rm -f $(DESTDIR)$(LIBDIR)/$(IMPLIB)106 endif107 99 108 100 install-dev: … … 171 163 172 164 $(subdirs): 173 $(MAKE) -C $@ $(MAKECMDGOALS)165 @$(MAKE) -C $@ $(MAKECMDGOALS) 174 166 175 167 $(OTR_PI): %.so: $(_SRCDIR_)%.c 176 168 @echo '*' Building plugin $@ 177 $(VERBOSE)$(CC) $(CFLAGS) -fPIC -shared $(LDFLAGS) $< -o $@ $(OTRFLAGS)169 @$(CC) $(CFLAGS) -fPIC -shared $(LDFLAGS) $< -o $@ $(OTRFLAGS) 178 170 179 171 $(SKYPE_PI): $(_SRCDIR_)protocols/skype/skype.c 180 172 @echo '*' Building plugin skype 181 $(VERBOSE)$(CC) $(CFLAGS) $(LDFLAGS) $(SKYPEFLAGS) $< -o $@173 @$(CC) $(CFLAGS) $(LDFLAGS) $(SKYPEFLAGS) $< -o $@ 182 174 183 175 $(objects): %.o: $(_SRCDIR_)%.c 184 176 @echo '*' Compiling $< 185 $(VERBOSE)$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@177 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 186 178 187 179 $(objects): Makefile Makefile.settings config.h … … 189 181 $(OUTFILE): $(objects) $(subdirs) 190 182 @echo '*' Linking $(OUTFILE) 191 $(VERBOSE)$(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LDFLAGS_BITLBEE) $(LDFLAGS) $(EFLAGS)192 ifn eq ($(firstword $(STRIP)), \#)183 @$(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LDFLAGS_BITLBEE) $(LDFLAGS) $(EFLAGS) 184 ifndef DEBUG 193 185 @echo '*' Stripping $(OUTFILE) 194 $(VERBOSE)-$(STRIP) $(OUTFILE)186 @-$(STRIP) $(OUTFILE) 195 187 endif 196 188 -
bitlbee.h
r7a9d968 r3f44e43 36 36 37 37 #define PACKAGE "BitlBee" 38 #define BITLBEE_VERSION "3. 5.1"38 #define BITLBEE_VERSION "3.4.2" 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, 5, 1)41 #define BITLBEE_VERSION_CODE BITLBEE_VER(3, 4, 2) 42 42 #define BITLBEE_ABI_VERSION_CODE 1 43 43 -
configure
r7a9d968 r3f44e43 15 15 datadir='$prefix/share/bitlbee/' 16 16 config='/var/lib/bitlbee/' 17 libdir='$prefix/lib/'18 17 plugindir='$prefix/lib/bitlbee/' 19 18 rpcplugindir='$plugindir/rpc/' … … 42 41 rpc=1 43 42 44 verbose=045 43 doc=1 46 44 debug=0 47 strip= 045 strip=1 48 46 gcov=0 49 47 asan=0 … … 131 129 --config=... $config 132 130 133 --verbose=0/1 Disable/enable verbose build $verbose134 135 131 --msn=0/1 Disable/enable MSN part $msn 136 132 --jabber=0/1 Disable/enable Jabber part $jabber … … 178 174 datadir=$(eval echo "$datadir/" | sed 's/\/\{1,\}/\//g') 179 175 config=$(eval echo "$config/" | sed 's/\/\{1,\}/\//g') 180 libdir=$(eval echo "$libdir/" | sed 's/\/\{1,\}/\//g')181 176 plugindir=$(eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g') 182 177 rpcplugindir=$(eval echo "$rpcplugindir/" | sed 's/\/\{1,\}/\//g') … … 204 199 RPCPLUGINDIR=$rpcplugindir 205 200 CONFIG=$config 206 LIBDIR=$libdir207 201 INCLUDEDIR=$includedir 208 202 PCDIR=$pcdir … … 254 248 #define PLUGINDIR "$plugindir" 255 249 #define RPCPLUGINDIR "$rpcplugindir" 256 #define DATADIR "$datadir"257 250 #define PIDFILE "$pidfile" 258 251 #define IPCSOCKET "$ipcsocket" … … 303 296 fi 304 297 305 if [ "$verbose" = "0" ]; then306 echo 'VERBOSE=@' >> Makefile.settings307 else308 echo 'VERBOSE=' >> Makefile.settings309 fi310 311 cat <<EOF >>Makefile.settings312 313 # Enable/disable output verbosity314 ifdef V315 ifeq (\$(V),1)316 VERBOSE=317 else318 VERBOSE=@319 endif320 endif321 322 EOF323 324 298 if [ "$debug" = "1" ]; then 325 299 echo 'DEBUG=1' >> Makefile.settings 326 300 CFLAGS="$CFLAGS -g3 -DDEBUG -O0" 327 301 else 328 [ -z "$CFLAGS" ] && CFLAGS="- g -O2 -fno-strict-aliasing"302 [ -z "$CFLAGS" ] && CFLAGS="-O2 -fno-strict-aliasing" 329 303 fi 330 304 … … 790 764 if [ "$doc" = "1" ]; then 791 765 # check this here just in case someone tries to install it in python2.4... 792 if [ ! -e $srcdir/doc/user-guide/help.txt ] &&! $PYTHON -m xml.etree.ElementTree > /dev/null 2>&1; then766 if ! $PYTHON -m xml.etree.ElementTree > /dev/null 2>&1; then 793 767 echo 794 768 echo 'ERROR: Python (>=2.5 or 3.x) is required to generate docs' … … 823 797 fi 824 798 825 pkgconfiglibs=''826 case "$arch" in827 CYGWIN* )828 pkgconfiglibs='-L${libdir} -lbitlbee -no-undefined'829 esac830 831 799 cat <<EOF >bitlbee.pc 832 800 prefix=$prefix … … 834 802 plugindir=$plugindir 835 803 rpcplugindir=$rpcplugindir 836 libdir=$libdir837 datadir=$datadir838 804 839 805 Name: bitlbee … … 841 807 Requires: glib-2.0 842 808 Version: $BITLBEE_VERSION 843 Libs: $pkgconfiglibs809 Libs: 844 810 Cflags: -I\${includedir} 845 811 … … 959 925 ;; 960 926 CYGWIN* ) 961 echo 'EFLAGS+=-Wl,--export-all,--out-implib,libbitlbee.dll.a' >> Makefile.settings962 echo 'IMPLIB=libbitlbee.dll.a' >> Makefile.settings963 927 ;; 964 928 Windows ) -
dcc.c
r7a9d968 r3f44e43 92 92 struct sockaddr_storage saddr; 93 93 char *errmsg; 94 char host[ NI_MAXHOST];94 char host[HOST_NAME_MAX]; 95 95 char port[6]; 96 96 -
debian/README.Debian
r7a9d968 r3f44e43 1 Fire up your favourite IRC client and connect to localhost:6667, 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), 2 30 and read the documentation (type help for a list of commands). 3 31 -
debian/bitlbee-common.init
r7a9d968 r3f44e43 23 23 [ -x $DAEMON ] || exit 0 24 24 25 # Default value 26 BITLBEE_PORT=6667 25 27 BITLBEE_OPTS=-F 28 29 # Read config file if it is present. 30 if [ -r /etc/default/$NAME ]; then 31 . /etc/default/$NAME 32 fi 26 33 27 34 … … 35 42 36 43 start-stop-daemon --start --quiet --pidfile $PIDFILE \ 37 --exec $DAEMON -- - P $PIDFILE $BITLBEE_OPTS44 --exec $DAEMON -- -p $BITLBEE_PORT -P $PIDFILE $BITLBEE_OPTS 38 45 } 39 46 … … 49 56 case "$1" in 50 57 start) 58 [ "$BITLBEE_DISABLED" = "1" ] && exit 0 59 51 60 echo -n "Starting $DESC: $NAME" 52 61 d_start -
debian/bitlbee-common.postinst
r7a9d968 r3f44e43 3 3 set -e 4 4 5 . /usr/share/debconf/confmodule 6 7 db_get bitlbee/serveport 8 PORT="$RET" 9 5 10 CONFDIR=/var/lib/bitlbee/ 6 11 7 if [ -e /etc/default/bitlbee ]; then 8 cat <<EOF >/etc/default/bitlbee 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 9 33 ## /etc/default/bitlbee: Auto-generated/updated script. 10 34 ## 11 ## This file is deprecated and no longer used. 12 ## Please edit /etc/bitlbee/bitlbee.conf instead 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 13 52 EOF 14 53 15 fi 54 ## Bye-bye DebConf, we don't need you anymore. 55 db_stop 16 56 17 57 ## Restore the helpfile in case we weren't upgrading but just reconfiguring: … … 24 64 fi 25 65 26 if [ -n "$2" -a -x "/etc/init.d/bitlbee" ]; then66 if [ "$BITLBEE_UPGRADE_DONT_RESTART" != "1" -a -n "$2" -a -x "/etc/init.d/bitlbee" ]; then 27 67 invoke-rc.d bitlbee restart 28 68 fi … … 31 71 if [ -d $CONFDIR ] && chown -R bitlbee: $CONFDIR; then 32 72 echo 'BitlBee (probably) already installed, skipping user/configdir installation' 33 else 34 adduser --system --group --disabled-login --disabled-password --home /var/lib/bitlbee/ bitlbee 73 exit 0 35 74 fi 36 75 76 adduser --system --group --disabled-login --disabled-password --home /var/lib/bitlbee/ bitlbee 37 77 chmod 700 /var/lib/bitlbee/ 38 78 -
debian/bitlbee-common.postrm
r7a9d968 r3f44e43 5 5 if [ "$1" = "purge" ]; then 6 6 rm -f /etc/default/bitlbee 7 deluser --system bitlbee > /dev/null|| true7 deluser --system bitlbee || true 8 8 rm -rf /var/lib/bitlbee ## deluser doesn't seem to do this for homedirs in /var 9 9 fi -
debian/changelog
r7a9d968 r3f44e43 1 bitlbee (3.5-2) unstable; urgency=medium2 3 * TFW you find out the corrected fix diff posted on #821967 was still the4 broken one and you end up doing your third upload in a weekend. :-(5 Obviously build-* targets shouldn't call into binary-*, as that one6 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.18 did not. (Closes: #853017)9 10 -- Wilmer van der Gaast <wilmer@gaast.net> Sat, 28 Jan 2017 21:06:27 +000011 12 bitlbee (3.5-1.1) unstable; urgency=medium13 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 -030018 19 bitlbee (3.5-1) unstable; urgency=medium20 21 [ Jochen Sprickerhof ]22 * Drop dependency on net-tools23 24 [ dequis ]25 * Use dh_systemd26 * Drop support for /etc/default/bitlbee27 * Drop debconf and its translations (only used to ask for the port)28 * Add preinst script for a smoother transition to systemd units29 * Ignore the stdout of deluser, fixes postrm error exit code30 * Remove some mentions of yahoo in control and copyright31 * Remove outdated stuff from README.debian32 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 +000037 38 bitlbee (3.4.2-1.1) unstable; urgency=medium39 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 -070045 46 1 bitlbee (3.4.2-1) unstable; urgency=medium 47 2 -
debian/control
r7a9d968 r3f44e43 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) , python7 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) 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 20 Talk), ICQ, AIM, MSN and Twitter.19 say to people on other chat networks: Jabber (which includes Google Talk 20 and Facebook Chat), ICQ, AIM, MSN, Yahoo! and Twitter/Identica/Status.net. 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 30 Talk), ICQ, AIM, MSN and Twitter.29 say to people on other chat networks: Jabber (which includes Google Talk 30 and Facebook Chat), ICQ, AIM, MSN, Yahoo! and Twitter/Identica/Status.net. 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}, adduser41 Depends: ${misc:Depends}, net-tools, 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 46 Talk), ICQ, AIM, MSN and Twitter.45 say to people on other chat networks: Jabber (which includes Google Talk 46 and Facebook Chat), ICQ, AIM, MSN, Yahoo! and Twitter/Identica/Status.net. 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 57 Talk), ICQ, AIM, MSN and Twitter.56 say to people on other chat networks: Jabber (which includes Google Talk 57 and Facebook Chat), ICQ, AIM, MSN, Yahoo! and Twitter/Identica/Status.net. 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 67 Talk), ICQ, AIM, MSN and Twitter.66 say to people on other chat networks: Jabber (which includes Google Talk 67 and Facebook Chat), ICQ, AIM, MSN, Yahoo! and Twitter/Identica/Status.net. 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 79 Talk), ICQ, AIM, MSN and Twitter.78 say to people on other chat networks: Jabber (which includes Google Talk 79 and Facebook Chat), ICQ, AIM, MSN, Yahoo! and Twitter/Identica/Status.net. 80 80 . 81 81 This package contains a plugin that adds support for the Skype IM network. -
debian/copyright
r7a9d968 r3f44e43 11 11 12 12 Bits of third party code, also (L)GPLed: 13 * protocols/yahoo/ is libyahoo2 <http://libyahoo2.sf.net/>. 13 14 * Some parts (though there is very little left at this point) are borrowed 14 15 from Gaim (version 0.58), now known as Pidgin <http://www.pidgin.im/>. … … 17 18 * lib/json.[ch] is from <https://github.com/udp/json-parser> and licensed 18 19 under the modified BSD license. 19 * lib/canohost.[ch] is from OpenSSH and licenced under the BSD-3-clause20 licence.21 20 22 21 -
debian/rules
r7a9d968 r3f44e43 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 really46 # not that much work.)47 build-arch build-indep: build48 43 49 44 build: build-stamp … … 120 115 dh_installdebconf 121 116 ifeq ($(HAS_DH_SYSTEMD),1) 122 dh_systemd_enable --no-enable bitlbee.socket 123 dh_systemd_enable bitlbee.service 117 dh_systemd_enable 124 118 dh_installinit --init-script=bitlbee 125 119 dh_systemd_start -
doc/CHANGES
r7a9d968 r3f44e43 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 the10 result of an incomplete fix in the previous release and may result in11 remote DoS. Read the full security advisory at:12 https://bugs.bitlbee.org/ticket/128213 - After some investigation we decided to reclassify a crash fix from the14 previous release as a security issue. Read the full security advisory at:15 https://bugs.bitlbee.org/ticket/128116 - Included help.txt in the release tarball, which was missing in the previous17 release and resulted in adding python as a build dependency. The release18 tarball of 3.5.1 does not require python.19 20 Finished 30 Jan 201721 22 Version 3.5:23 24 - ui:25 * "chat list": shows a list of existing server-side chatrooms. With some26 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 globally31 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 transfers36 * Don't send parts in a chat if someone is still connected from other devices37 * 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 required46 ones are missing. Look for purple_ prefixed settings in "chan #... set"47 * SIPE: persistent chats can be joined now, thanks to the "chat list" command48 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 protocols52 (hangouts, funyahoo, icq, line)53 * LINE: added a hack to save its auth token, to avoid re-auth every time54 * 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. An62 account that is marked with the locked="true" attribute can't be removed63 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 mostly71 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 used75 for ABI version checking in the future. It's optional for now, but will be76 enforced later. See the commit log of d28fe1c for details. (jgeboski)77 78 Finished 8 Jan 201779 5 80 6 Version 3.4.2: -
doc/README
r7a9d968 r3f44e43 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 163 166 164 167 BitlBee - An IRC to other chat networks gateway -
doc/bitlbee.8
r7a9d968 r3f44e43 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. 41 &bitlbee. It currently supports Oscar (AIM and ICQ), 42 MSN, Jabber, Yahoo! and Twitter. 42 43 43 44 \fBbitlbee\fP should be called by -
doc/user-guide/Installation.xml
r7a9d968 r3f44e43 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, twitter- By default, support for all38 <listitem><para>msn, jabber, oscar, yahoo - 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
r7a9d968 r3f44e43 35 35 xsltproc --xinclude --output $@ docbook.xsl $< 36 36 37 help.txt: $(_SRCDIR_)help.xml $(_SRCDIR_)commands.xml $(_SRCDIR_)misc.xml $(_SRCDIR_)quickstart.xml $(_SRCDIR_)twitter.xml37 help.txt: $(_SRCDIR_)help.xml $(_SRCDIR_)commands.xml $(_SRCDIR_)misc.xml $(_SRCDIR_)quickstart.xml 38 38 $(PYTHON) $(_SRCDIR_)genhelp.py $< $@ 39 39 -
doc/user-guide/commands.xml
r7a9d968 r3f44e43 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. 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>.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>. 24 24 </para> 25 25 … … 184 184 <bitlbee-command name="channel"> 185 185 <short-description>Channel list maintenance</short-description> 186 <syntax>channel [< channelid>] <action> [<arguments>]</syntax>186 <syntax>channel [<account id>] <action> [<arguments>]</syntax> 187 187 188 188 <description> … … 277 277 <description> 278 278 <para> 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. 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. 284 280 </para> 285 281 </description> … … 342 338 <description> 343 339 <para> 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.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. 345 341 </para> 346 342 </description> … … 891 887 <description> 892 888 <para> 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. 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. 894 907 </para> 895 908 </description> … … 991 1004 </bitlbee-setting> 992 1005 993 <bitlbee-setting name="handle_unknown" type="string" scope=" account,global">1006 <bitlbee-setting name="handle_unknown" type="string" scope="global"> 994 1007 <default>add_channel</default> 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)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. 1000 1013 </para> 1001 1014 1002 1015 <para> 1003 1016 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.1008 1017 </para> 1009 1018 … … 1028 1037 </bitlbee-setting> 1029 1038 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 1030 1050 <bitlbee-setting name="local_display_name" type="boolean" scope="account"> 1031 1051 <default>false</default> … … 1044 1064 <description> 1045 1065 <para> 1046 Some protocols can notify via IM about new e-mail. If you want these notifications, you can enable this setting.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. 1047 1067 </para> 1048 1068 </description> … … 1192 1212 </para> 1193 1213 </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 1224 1214 </bitlbee-setting> 1225 1215 … … 1860 1850 <bitlbee-command name="plugins"> 1861 1851 <short-description>List all the external plugins and protocols</short-description> 1862 <syntax>plugins [info <name>]</syntax>1852 <syntax>plugins</syntax> 1863 1853 1864 1854 <description> 1865 1855 <para> 1866 1856 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.1871 1857 </para> 1872 1858 </description> -
doc/user-guide/genhelp.py
r7a9d968 r3f44e43 73 73 74 74 def process_file(filename, parent=None): 75 try: 76 tree = ET.parse(open(filename)).getroot() 77 except: 78 sys.stderr.write("\nException while processing %s\n" % filename) 79 raise 75 tree = ET.parse(open(filename)).getroot() 80 76 fix_tree(tree) 81 77 return parse_tag(tree, parent) -
doc/user-guide/help.xml
r7a9d968 r3f44e43 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> identify_methods</term><listitem><para>A list of ways to (auto-)identify to your account</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> 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> identify_methods</term><listitem><para>A list of ways to (auto-)identify to your account</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> 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"/>63 62 <xi:include href="misc.xml"/> 64 63 -
doc/user-guide/misc.xml
r7a9d968 r3f44e43 77 77 78 78 <para> 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> 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 85 82 </sect1> 86 83 … … 268 265 everything in the handle up to the first @. 269 266 </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>304 267 305 268 </sect1> … … 499 462 </sect1> 500 463 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 517 464 </chapter> -
doc/user-guide/quickstart.xml
r7a9d968 r3f44e43 3 3 4 4 <para> 5 Welcome to BitlBee, your IRC gateway to other instant messaging protocols.5 Welcome to BitlBee, your IRC gateway to ICQ, MSN, AOL, Jabber, Yahoo! and Twitter. 6 6 </para> 7 7 … … 43 43 44 44 <para> 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>. 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>. 50 46 </para> 51 47 … … 140 136 141 137 <para> 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!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! 143 139 </para> 144 140 -
doc/user-guide/user-guide.xml
r7a9d968 r3f44e43 37 37 <xi:include href="quickstart.xml"/> 38 38 <xi:include href="commands.xml"/> 39 <xi:include href="twitter.xml"/>40 39 <xi:include href="misc.xml"/> 41 40 -
init/bitlbee.service.in
r7a9d968 r3f44e43 1 1 [Unit] 2 2 Description=BitlBee IRC/IM gateway 3 After=syslog.target 3 4 4 5 [Service] -
init/bitlbee@.service.in
r7a9d968 r3f44e43 1 1 [Unit] 2 2 Description=BitlBee Per-Connection Server 3 After=syslog.target 3 4 4 5 [Service] 5 6 ExecStart=@sbindir@bitlbee -I 6 7 StandardInput=socket 7 StandardError=syslog8 8 User=bitlbee -
ipc.c
r7a9d968 r3f44e43 898 898 strcpy(un_addr.sun_path, IPCSOCKET); 899 899 900 serversock = socket(AF_UNIX, SOCK_STREAM, 0);900 serversock = socket(AF_UNIX, SOCK_STREAM, PF_UNIX); 901 901 902 902 if (serversock == -1) { -
irc.c
r7a9d968 r3f44e43 25 25 26 26 #include "bitlbee.h" 27 #include "canohost.h"28 27 #include "ipc.h" 29 28 #include "dcc.h" … … 42 41 { 43 42 irc_t *irc; 43 struct sockaddr_storage sock; 44 socklen_t socklen = sizeof(sock); 45 char *host = NULL, *myhost = NULL; 44 46 irc_user_t *iu; 45 47 GSList *l; … … 62 64 irc->iconv = (GIConv) - 1; 63 65 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 } 64 93 65 94 if (global.conf->ping_interval > 0 && global.conf->ping_timeout > 0) { … … 84 113 s = set_add(&b->set, "last_version", "0", NULL, irc); 85 114 s->flags |= SET_HIDDEN; 115 s = set_add(&b->set, "lcnicks", "true", set_eval_bool, irc); 86 116 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);89 117 s = set_add(&b->set, "offline_user_quits", "true", set_eval_bool, irc); 90 118 s = set_add(&b->set, "ops", "both", set_eval_irc_channel_ops, irc); … … 109 137 110 138 irc->root = iu = irc_user_new(irc, ROOT_NICK); 139 iu->host = g_strdup(myhost); 111 140 iu->fullname = g_strdup(ROOT_FN); 112 141 iu->f = &irc_user_root_funcs; 113 142 114 143 iu = irc_user_new(irc, NS_NICK); 144 iu->host = g_strdup(myhost); 115 145 iu->fullname = g_strdup(ROOT_FN); 116 146 iu->f = &irc_user_root_funcs; 117 147 118 148 irc->user = g_new0(irc_user_t, 1); 119 120 irc_set_hosts(irc, NULL, 0); 149 irc->user->host = g_strdup(host); 121 150 122 151 conf_loaddefaults(irc); … … 134 163 } 135 164 165 g_free(myhost); 166 g_free(host); 167 136 168 /* libpurple doesn't like fork()s after initializing itself, so this 137 169 is the right moment to initialize it. */ … … 153 185 154 186 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);201 187 } 202 188 -
irc.h
r7a9d968 r3f44e43 26 26 #ifndef _IRC_H 27 27 #define _IRC_H 28 29 #include <sys/socket.h>30 28 31 29 #define IRC_MAX_LINE 512 … … 273 271 274 272 irc_t *irc_new(int fd); 275 void irc_set_hosts(irc_t *irc, const struct sockaddr *remote_addr, const socklen_t remote_addrlen);276 273 void irc_abort(irc_t *irc, int immed, char *format, ...) G_GNUC_PRINTF(3, 4); 277 274 void irc_free(irc_t *irc); -
irc_channel.c
r7a9d968 r3f44e43 638 638 irc_channel_name_strip(name); 639 639 640 if (set_getbool(&irc->b->set, " nick_lowercase")) {640 if (set_getbool(&irc->b->set, "lcnicks")) { 641 641 nick_lc(irc, name + 1); 642 642 } -
irc_commands.c
r7a9d968 r3f44e43 26 26 #define BITLBEE_CORE 27 27 #include "bitlbee.h" 28 #include "canohost.h"29 28 #include "help.h" 30 29 #include "ipc.h" … … 58 57 irc_check_login(irc); 59 58 } 60 }61 62 /* http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt63 64 This isn't actually IRC, it's used by for example stunnel4 to indicate65 the origin of the secured counterpart of the connection. It'll go wrong66 with arguments starting with : like for example "::1" but I guess I'm67 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 for89 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);102 59 } 103 60 … … 851 808 { "cap", 1, irc_cmd_cap, 0 }, 852 809 { "pass", 1, irc_cmd_pass, 0 }, 853 { "proxy", 5, irc_cmd_proxy, IRC_CMD_PRE_LOGIN },854 810 { "user", 4, irc_cmd_user, IRC_CMD_PRE_LOGIN }, 855 811 { "nick", 1, irc_cmd_nick, 0 }, -
irc_im.c
r7a9d968 r3f44e43 89 89 90 90 if (bu->flags & BEE_USER_LOCAL) { 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) { 91 char *s = set_getstr(&bee->set, "handle_unknown"); 92 93 if (strcmp(s, "add_private") == 0) { 95 94 iu->last_channel = NULL; 96 } else if ( g_strcasecmp(s, "add_channel") == 0) {95 } else if (strcmp(s, "add_channel") == 0) { 97 96 iu->last_channel = irc->default_channel; 98 97 } … … 635 634 } 636 635 636 if (ic->flags & IRC_CHANNEL_JOINED) { 637 irc_channel_printf(ic, "Cleaning up channel, bye!"); 638 } 639 637 640 ic->data = NULL; 638 641 c->ui_data = NULL; -
lib/Makefile
r7a9d968 r3f44e43 13 13 14 14 # [SH] Program variables 15 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.o15 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.o 16 16 17 17 LFLAGS += -r … … 36 36 lib.o: $(objects) $(subdirs) 37 37 @echo '*' Linking lib.o 38 $(VERBOSE)$(LD) $(LFLAGS) $(objects) -o lib.o38 @$(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 $(VERBOSE)$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@44 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 45 45 46 46 -include .depend/*.d -
lib/ftutil.c
r7a9d968 r3f44e43 42 42 struct addrinfo hints, *rp; 43 43 socklen_t ssize = sizeof(struct sockaddr_storage); 44 struct sockaddr_storage saddrs = {0}, *saddr = &saddrs;44 struct sockaddr_storage saddrs, *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, NI_MAXHOST);65 strncpy(host, ftlisten, HOST_NAME_MAX); 66 66 *scolon = ';'; 67 67 } else { 68 strncpy(host, scolon + 1, NI_MAXHOST);68 strncpy(host, scolon + 1, HOST_NAME_MAX); 69 69 } 70 70 } else { 71 strncpy(host, ftlisten, NI_MAXHOST);71 strncpy(host, ftlisten, HOST_NAME_MAX); 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, NI_MAXHOST,80 getnameinfo((struct sockaddr*) &saddrs, ssize, host, HOST_NAME_MAX, 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, NI_MAXHOST), "gethostname()");86 ASSERTSOCKOP(gethostname(host, HOST_NAME_MAX + 1), "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, NI_MAXHOST)) {111 host, HOST_NAME_MAX)) { 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[ NI_MAXHOST- 1] = '\0';130 host[HOST_NAME_MAX - 1] = '\0'; 131 131 port[5] = '\0'; 132 132 -
lib/ftutil.h
r7a9d968 r3f44e43 26 26 #endif 27 27 28 /* Some ifdefs for ulibc and apparently also BSD (Thanks to Whoopie) */ 29 #ifndef HOST_NAME_MAX 30 #include <sys/param.h> 31 #ifdef MAXHOSTNAMELEN 32 #define HOST_NAME_MAX MAXHOSTNAMELEN 33 #else 34 #define HOST_NAME_MAX 255 35 #endif 36 #endif 37 28 38 /* This function should be used with care. host should be AT LEAST a 29 char[ NI_MAXHOST+1] and port AT LEAST a char[6]. */39 char[HOST_NAME_MAX+1] and port AT LEAST a char[6]. */ 30 40 int ft_listen(struct sockaddr_storage *saddr_ptr, char *host, char *port, int copy_fd, int for_bitlbee_client, 31 41 char **errptr); -
lib/misc.c
r7a9d968 r3f44e43 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 337 382 /* Convert from one charset to another. 338 383 -
lib/misc.h
r7a9d968 r3f44e43 29 29 #include <gmodule.h> 30 30 #include <time.h> 31 #include <sys/socket.h>32 31 33 32 struct ns_srv_reply { … … 131 130 G_MODULE_EXPORT void http_encode(char *s); 132 131 132 G_MODULE_EXPORT char *ipv6_wrap(char *src); 133 G_MODULE_EXPORT char *ipv6_unwrap(char *src); 134 133 135 G_MODULE_EXPORT signed int do_iconv(char *from_cs, char *to_cs, char *src, char *dst, size_t size, size_t maxbuf); 134 136 -
nick.c
r7a9d968 r3f44e43 94 94 95 95 nick_strip(irc, nick); 96 if (set_getbool(&bu->bee->set, " nick_lowercase")) {96 if (set_getbool(&bu->bee->set, "lcnicks")) { 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 222 217 truncate_utf8(rets, MAX_NICK_LENGTH); 223 218 return rets; … … 293 288 { 294 289 int len = 0; 295 gboolean nick_underscores = irc ? set_getbool(&irc->b->set, "nick_underscores") : FALSE;296 290 297 291 if (irc && (irc->status & IRC_UTF8_NICKS)) { … … 303 297 n = g_utf8_find_next_char(p, NULL); 304 298 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))) || 299 if ((c < 0x7f && !(strchr(nick_lc_chars, c) || 300 strchr(nick_uc_chars, c))) || 310 301 !g_unichar_isgraph(c)) { 311 302 strcpy(tmp, n); … … 322 313 323 314 for (i = len = 0; nick[i] && len < MAX_NICK_LENGTH; i++) { 324 if (nick_underscores && nick[i] == ' ') { 325 nick[len] = '_'; 326 len++; 327 } else if (strchr(nick_lc_chars, nick[i]) || 315 if (strchr(nick_lc_chars, nick[i]) || 328 316 strchr(nick_uc_chars, nick[i])) { 329 317 nick[len] = nick[i]; -
otr.c
r7a9d968 r3f44e43 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 g_return_val_if_fail(l, NULL);1516 assert(l != NULL); /* a match should always be found */ 1517 1517 if (!l) { 1518 1518 return NULL; -
protocols/Makefile
r7a9d968 r3f44e43 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 $(VERBOSE)$(LD) $(LFLAGS) $(objects) $(subdirobjs) -o protocols.o51 @$(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 $(VERBOSE)$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@57 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 58 58 59 59 -include .depend/*.d -
protocols/account.c
r7a9d968 r3f44e43 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;60 57 61 58 s = set_add(&a->set, "nick_format", NULL, NULL, a); -
protocols/bee_user.c
r7a9d968 r3f44e43 170 170 171 171 if (!(bu = bee_user_by_handle(bee, ic, handle))) { 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) { 172 if (g_strcasecmp(set_getstr(&ic->bee->set, "handle_unknown"), "add") == 0) { 176 173 bu = bee_user_new(bee, ic, handle, BEE_USER_LOCAL); 177 174 } else { 178 if (g_strcasecmp( h, "ignore") != 0) {175 if (g_strcasecmp(set_getstr(&ic->bee->set, "handle_unknown"), "ignore") != 0) { 179 176 imcb_log(ic, "imcb_buddy_status() for unknown handle %s:\n" 180 177 "flags = %d, state = %s, message = %s", handle, flags, … … 258 255 259 256 if (!bu && !(ic->flags & OPT_LOGGING_OUT)) { 260 char *h = set_getstr(&ic->acc->set, "handle_unknown") ? : 261 set_getstr(&ic->bee->set, "handle_unknown"); 257 char *h = set_getstr(&bee->set, "handle_unknown"); 262 258 263 259 if (g_strcasecmp(h, "ignore") == 0) { -
protocols/jabber/Makefile
r7a9d968 r3f44e43 38 38 $(objects): %.o: $(_SRCDIR_)%.c 39 39 @echo '*' Compiling $< 40 $(VERBOSE)$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@40 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 41 41 42 42 jabber_mod.o: $(objects) 43 43 @echo '*' Linking jabber_mod.o 44 $(VERBOSE)$(LD) $(LFLAGS) $(objects) -o jabber_mod.o44 @$(LD) $(LFLAGS) $(objects) -o jabber_mod.o 45 45 46 46 -include .depend/*.d -
protocols/jabber/conference.c
r7a9d968 r3f44e43 167 167 jabber_buddy_remove_bare(c->ic, jc->name); 168 168 169 g_free(jc->last_sent_message);170 169 g_free(jc->my_full_jid); 171 170 g_free(jc->name); … … 188 187 189 188 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);193 189 194 190 return !jabber_write_packet(ic, node); … … 329 325 } 330 326 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);334 327 } 335 328 … … 354 347 } 355 348 356 imcb_chat_add_buddy(chat, bud->ext_jid);357 358 349 if (bud != jc->me && (jc->flags & JCFLAG_ALWAYS_USE_NICKS) && !(bud->flags & JBFLAG_IS_ANONYMOUS)) { 359 350 imcb_buddy_nick_change(ic, bud->ext_jid, bud->resource); 360 351 } 361 352 353 imcb_chat_add_buddy(chat, bud->ext_jid); 362 354 if (s) { 363 355 *s = '/'; … … 502 494 imcb_chat_log(chat, "From conference server: %s", body->text); 503 495 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 } 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; 514 500 } 515 501 -
protocols/jabber/jabber.h
r7a9d968 r3f44e43 161 161 struct jabber_buddy *me; 162 162 char *invite; 163 char *last_sent_message;164 163 }; 165 164 -
protocols/jabber/s5bytestream.c
r7a9d968 r3f44e43 500 500 case BS_PHASE_REPLY: 501 501 { 502 struct socks5_message socks5_reply = {0};502 struct socks5_message socks5_reply; 503 503 int ret; 504 504 … … 888 888 char *proxy, *next, *errmsg = NULL; 889 889 char port[6]; 890 char host[ NI_MAXHOST+ 1];890 char host[HOST_NAME_MAX + 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 = {0};1048 } socks5_hello; 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 = {0};1093 struct socks5_message socks5_connect; 1094 1094 int msgsize = sizeof(struct socks5_message); 1095 1095 int ret; -
protocols/msn/Makefile
r7a9d968 r3f44e43 38 38 $(objects): %.o: $(_SRCDIR_)%.c 39 39 @echo '*' Compiling $< 40 $(VERBOSE)$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@40 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 41 41 42 42 msn_mod.o: $(objects) 43 43 @echo '*' Linking msn_mod.o 44 $(VERBOSE)$(LD) $(LFLAGS) $(objects) -o msn_mod.o44 @$(LD) $(LFLAGS) $(objects) -o msn_mod.o 45 45 46 46 -include .depend/*.d -
protocols/msn/msn_util.c
r7a9d968 r3f44e43 180 180 if (getenv("BITLBEE_DEBUG")) { 181 181 fprintf(stderr, "\n\x1b[92m<<< "); 182 fwrite(bytes, st, 1, stderr);182 write(2, bytes , st); 183 183 fprintf(stderr, "\x1b[97m"); 184 184 } -
protocols/msn/soap.c
r7a9d968 r3f44e43 213 213 if (headers) { 214 214 if ((s = strstr(headers, "\r\n\r\n"))) { 215 fwrite(headers, s - headers + 4, 1, stderr);215 write(2, headers, s - headers + 4); 216 216 } else { 217 fwrite(headers, strlen(headers), 1, stderr);217 write(2, headers, strlen(headers)); 218 218 } 219 219 } -
protocols/nogaim.c
r7a9d968 r3f44e43 50 50 } 51 51 52 /* semi-private */ 53 gboolean plugin_info_validate(struct plugin_info *info, const char *path) 52 gboolean load_plugin(char *path) 54 53 { 55 54 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 103 gboolean load_plugin(char *path) 104 { 105 struct plugin_info *info = NULL; 55 struct plugin_info *i; 56 struct plugin_info *info; 106 57 struct plugin_info * (*info_function) (void) = NULL; 107 58 void (*init_function) (void); 108 59 109 60 GModule *mod = g_module_open(path, G_MODULE_BIND_LAZY); 61 gboolean loaded = FALSE; 110 62 111 63 if (!mod) { … … 117 69 info = info_function(); 118 70 119 if (!plugin_info_validate(info, path)) { 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); 120 101 g_module_close(mod); 121 102 return FALSE; … … 132 113 133 114 if (info_function) { 134 plugin_info_add(info); 115 plugins = g_list_insert_sorted_with_data(plugins, info, 116 pluginscmp, NULL); 135 117 } 136 118 … … 815 797 msg = ic->acc->flags & ACC_FLAG_AWAY_MESSAGE ? away : NULL; 816 798 away = imc_away_state_find(m, away, &msg) ? : 817 (imc_away_state_find(m, "away", NULL) ? : m->data);799 (imc_away_state_find(m, "away", &msg) ? : m->data); 818 800 } else if (ic->acc->flags & ACC_FLAG_STATUS_MESSAGE) { 819 801 away = NULL; … … 849 831 contains no data unless it adds something to what 850 832 we have in state already. */ 851 if ( message &&strlen(m->data) == strlen(away)) {833 if (strlen(m->data) == strlen(away)) { 852 834 *message = NULL; 853 835 } … … 875 857 for (m = gcm; m; m = m->next) { 876 858 if (g_strcasecmp(imc_away_alias_list[i][j], m->data) == 0) { 877 if (!keep_message && message) {859 if (!keep_message) { 878 860 *message = NULL; 879 861 } -
protocols/oscar/Makefile
r7a9d968 r3f44e43 39 39 $(objects): %.o: $(_SRCDIR_)%.c 40 40 @echo '*' Compiling $< 41 $(VERBOSE)$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@41 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 42 42 43 43 oscar_mod.o: $(objects) 44 44 @echo '*' Linking oscar_mod.o 45 $(VERBOSE)$(LD) $(LFLAGS) $(objects) -o oscar_mod.o45 @$(LD) $(LFLAGS) $(objects) -o oscar_mod.o 46 46 47 47 -include .depend/*.d -
protocols/oscar/rxhandlers.c
r7a9d968 r3f44e43 235 235 struct aim_rxcblist_s *newcb; 236 236 237 g_return_val_if_fail(conn, -1); 238 g_return_val_if_fail(!checkdisallowed(family, type), -1); 237 if (!conn) { 238 return -1; 239 } 240 241 if (checkdisallowed(family, type)) { 242 g_assert(0); 243 return -1; 244 } 239 245 240 246 if (!(newcb = (struct aim_rxcblist_s *) g_new0(struct aim_rxcblist_s, 1))) { -
protocols/purple/Makefile
r7a9d968 r3f44e43 39 39 $(objects): %.o: $(_SRCDIR_)%.c 40 40 @echo '*' Compiling $< 41 $(VERBOSE)$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@41 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 42 42 43 43 purple_mod.o: $(objects) 44 44 @echo '*' Linking purple_mod.o 45 $(VERBOSE)$(LD) $(LFLAGS) $(objects) -o purple_mod.o45 @$(LD) $(LFLAGS) $(objects) -o purple_mod.o 46 46 47 47 -include .depend/*.d -
protocols/purple/bpurple.h
r7a9d968 r3f44e43 6 6 7 7 #define PURPLE_REQUEST_HANDLE "purple_request" 8 9 #define PURPLE_OPT_SHOULD_SET_NICK 110 8 11 9 struct purple_data … … 17 15 char *chat_list_server; 18 16 GSList *filetransfers; 19 20 int flags;21 17 }; 22 18 -
protocols/purple/ft.c
r7a9d968 r3f44e43 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 }152 148 px->ft->data = px; 153 149 -
protocols/purple/purple.c
r7a9d968 r3f44e43 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 should119 * always offer the 'alias' as a nick. this is just so that users don't have to do120 * '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 140 116 static void purple_init(account_t *acc) 141 117 { … … 305 281 } 306 282 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 312 283 /* Go through all away states to figure out if away/status messages 313 284 are possible. */ … … 373 344 purple_account_set_check_mail(pa, set_getbool(&acc->set, "mail_notifications")); 374 345 } 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 }380 346 } 381 347 … … 406 372 purple_account_set_password(pd->account, acc->pass); 407 373 purple_sync_settings(acc, pd->account); 408 409 if (purple_account_should_set_nick(acc)) {410 pd->flags = PURPLE_OPT_SHOULD_SET_NICK;411 }412 374 413 375 purple_account_set_enabled(pd->account, "BitlBee", TRUE); … … 779 741 struct groupchat *gc; 780 742 GList *info, *l; 781 GString *missing_settings = NULL;782 743 783 744 if (!pi->chat_info || !pi->chat_info_defaults || … … 805 766 } else if (strcmp(pce->identifier, "passwd") == 0) { 806 767 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);829 768 } 830 769 … … 833 772 834 773 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 }846 774 847 775 /* do this before serv_join_chat to handle cases where prplcb_conv_new is called immediately (not async) */ … … 878 806 purple_roomlist_ref(list); 879 807 } 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 none895 * 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);935 808 } 936 809 … … 971 844 { 972 845 struct im_connection *ic = purple_ic_by_gc(gc); 973 struct purple_data *pd = ic->proto_data; 974 const char *dn, *token; 846 const char *dn; 975 847 set_t *s; 976 848 … … 985 857 // user list needs to be requested for Gadu-Gadu 986 858 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 }994 859 995 860 ic->flags |= OPT_DOES_HTML; … … 1043 908 PurpleGroup *group = purple_buddy_get_group(bud); 1044 909 struct im_connection *ic = purple_ic_by_pa(bud->account); 1045 struct purple_data *pd = ic->proto_data;1046 910 PurpleStatus *as; 1047 911 int flags = 0; 1048 char *alias = NULL;1049 912 1050 913 if (ic == NULL) { … … 1052 915 } 1053 916 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 } 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); 1061 921 } 1062 922 … … 1202 1062 } 1203 1063 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. */ 1064 /* Handles write_im and write_chat. Removes echoes of locally sent messages */ 1209 1065 static void prplcb_conv_msg(PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, time_t mtime) 1210 1066 { 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);1067 if (!(flags & PURPLE_MESSAGE_SEND)) { 1068 handle_conv_msg(conv, who, message, 0, mtime); 1213 1069 } 1214 1070 } … … 1536 1392 } 1537 1393 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 1552 1394 static void prplcb_roomlist_add_room(PurpleRoomlist *list, PurpleRoomlistRoom *room) 1553 1395 { 1554 1396 bee_chat_info_t *ci; 1555 c har *title;1397 const char *title; 1556 1398 const char *topic; 1557 1399 GList *fields; … … 1559 1401 1560 1402 fields = purple_roomlist_room_get_fields(room); 1561 title = p rplcb_roomlist_get_room_name(list,room);1403 title = purple_roomlist_room_get_name(room); 1562 1404 1563 1405 if (rld->topic >= 0) { … … 1568 1410 1569 1411 ci = g_new(bee_chat_info_t, 1); 1570 ci->title = title;1412 ci->title = g_strdup(title); 1571 1413 ci->topic = g_strdup(topic); 1572 1414 rld->chats = g_slist_prepend(rld->chats, ci); … … 1790 1632 } 1791 1633 1792 /* borrowing this semi-private function1793 * TODO: figure out a better interface later (famous last words) */1794 gboolean plugin_info_add(struct plugin_info *info);1795 1796 1634 void purple_initmodule() 1797 1635 { … … 1800 1638 GString *help; 1801 1639 char *dir; 1802 gboolean debug_enabled = !!getenv("BITLBEE_DEBUG");1803 1640 1804 1641 if (purple_get_core() != NULL) { … … 1808 1645 } 1809 1646 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);1647 g_assert((int) B_EV_IO_READ == (int) PURPLE_INPUT_READ); 1648 g_assert((int) B_EV_IO_WRITE == (int) PURPLE_INPUT_WRITE); 1812 1649 1813 1650 dir = g_strdup_printf("%s/purple", global.conf->configdir); … … 1819 1656 g_free(dir); 1820 1657 1821 purple_debug_set_enabled( debug_enabled);1658 purple_debug_set_enabled(FALSE); 1822 1659 purple_core_set_ui_ops(&bee_core_uiops); 1823 1660 purple_eventloop_set_ui_ops(&glib_eventloops); … … 1827 1664 abort(); 1828 1665 } 1829 purple_debug_set_enabled(FALSE);1830 1666 1831 1667 if (proxytype != PROXY_NONE) { … … 1886 1722 funcs.chat_join = purple_chat_join; 1887 1723 funcs.chat_list = purple_chat_list; 1888 funcs.chat_add_settings = purple_chat_add_settings;1889 funcs.chat_free_settings = purple_chat_free_settings;1890 1724 funcs.transfer_request = purple_transfer_request; 1891 1725 … … 1898 1732 PurplePluginProtocolInfo *pi = prot->info->extra_info; 1899 1733 struct prpl *ret; 1900 struct plugin_info *info;1901 1734 1902 1735 /* If we already have this one (as a native module), don't … … 1933 1766 register_protocol(ret); 1934 1767 } 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);1945 1768 } 1946 1769 -
protocols/twitter/Makefile
r7a9d968 r3f44e43 38 38 $(objects): %.o: $(_SRCDIR_)%.c 39 39 @echo '*' Compiling $< 40 $(VERBOSE)$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@40 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 41 41 42 42 twitter_mod.o: $(objects) 43 43 @echo '*' Linking twitter_mod.o 44 $(VERBOSE)$(LD) $(LFLAGS) $(objects) -o twitter_mod.o44 @$(LD) $(LFLAGS) $(objects) -o twitter_mod.o 45 45 46 46 -include .depend/*.d -
protocols/twitter/twitter.c
r7a9d968 r3f44e43 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 581 578 if (strcmp(acc->prpl->name, "twitter") == 0) { 582 579 s = set_add(&acc->set, "stream", "true", set_eval_bool, acc); -
protocols/twitter/twitter_lib.c
r7a9d968 r3f44e43 239 239 if ((ret = json_parse_string(req->reply_body)) == NULL) { 240 240 imcb_error(ic, "Could not retrieve %s: %s", 241 path, " JSONparse error");241 path, "XML parse error"); 242 242 } 243 243 return ret; … … 310 310 311 311 txl->list = g_slist_prepend(txl->list, 312 g_strdup_printf("% " PRIu64, id);312 g_strdup_printf("%lld", 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("% " PRId64, id));454 g_strdup_printf("%lld", 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. Grab the 715 /* New "retweets with comments" feature. Note that this info 716 * seems to be included in the streaming API only! Grab the 716 717 * full message and try to insert it when we run into the 717 718 * Tweet entity. */ … … 754 755 char *pos, *new; 755 756 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)) { 757 if (!kort || !disp || !(pos = strstr(*text, kort))) { 760 758 continue; 761 759 } … … 982 980 return; 983 981 } 984 982 985 983 /* Check this is not a tweet that should be muted */ 986 984 uid_str = g_strdup_printf("%" G_GUINT64_FORMAT, status->user->uid); … … 1693 1691 }; 1694 1692 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 1702 1693 twitter_http(ic, TWITTER_STATUS_UPDATE_URL, twitter_http_post, ic, 1, 1703 1694 args, in_reply_to ? 4 : 2); -
root_commands.c
r7a9d968 r3f44e43 1072 1072 format = "%s\t%s\t%s"; 1073 1073 } else { 1074 format = "%- 24.24s %-40.40s %s";1074 format = "%-16.16s %-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 1208 1174 static void cmd_plugins(irc_t *irc, char **cmd) 1209 1175 { 1210 1176 GList *prpls; 1211 1177 GString *gstr; 1212 1213 if (cmd[1] && g_strcasecmp(cmd[1], "info") == 0) {1214 cmd_plugins_info(irc, cmd);1215 return;1216 }1217 1178 1218 1179 #ifdef WITH_PLUGINS 1219 1180 GList *l; 1220 1181 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");1230 1182 1231 1183 for (l = get_plugins(); l; l = l->next) { 1232 char *c;1233 1184 info = l->data; 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 } 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, ""); 1243 1201 } 1244 1202 #endif 1245 1246 irc_rootmsg(irc, "");1247 1203 1248 1204 gstr = g_string_new(NULL); … … 1390 1346 } else if (g_strcasecmp(cmd[1], "set") == 0 || 1391 1347 g_strcasecmp(cmd[1], "del") == 0) { 1392 irc_rootmsg(irc, "Unknown command: chat %s. Did you mean \002channel %s\002?", cmd[1], cmd[1]); 1348 irc_rootmsg(irc, 1349 "Warning: The \002chat\002 command was mostly replaced with the \002channel\002 command."); 1350 cmd_channel(irc, cmd); 1393 1351 } else { 1394 1352 irc_rootmsg(irc, … … 1448 1406 topic = ci->topic ? ci->topic : ""; 1449 1407 1450 padded = str_pad_and_truncate(ci->title ? ci->title : "", title_len, "[...]");1408 padded = str_pad_and_truncate(ci->title, title_len, "[...]"); 1451 1409 irc_rootmsg(irc, iformat, ++i, padded, topic); 1452 1410 g_free(padded); -
set.c
r7a9d968 r3f44e43 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 || ( g_strcmp0(nv, s->def) != 0)) {167 if (!s->def || (strcmp(nv, s->def) != 0)) { 168 168 s->value = g_strdup(nv); 169 169 } -
storage.c
r7a9d968 r3f44e43 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
r7a9d968 r3f44e43 290 290 } 291 291 292 handle_settings(node, &xd->irc->b->set);293 294 292 if (xt_handle(xp, NULL, 1) == XT_HANDLED) { 295 293 ret = STORAGE_OK; 296 294 } 295 296 handle_settings(node, &xd->irc->b->set); 297 297 298 298 error: -
tests/Makefile
r7a9d968 r3f44e43 21 21 check: $(test_objs) $(addprefix ../, $(main_objs)) ../protocols/protocols.o ../lib/lib.o 22 22 @echo '*' Linking $@ 23 $(VERBOSE)$(CC) $(CFLAGS) -o $@ $^ $(LFLAGS) $(EFLAGS)23 @$(CC) $(CFLAGS) -o $@ $^ $(LFLAGS) $(EFLAGS) 24 24 25 25 %.o: $(_SRCDIR_)%.c 26 26 @echo '*' Compiling $< 27 $(VERBOSE)$(CC) -c $(CFLAGS) $< -o $@27 @$(CC) -c $(CFLAGS) $< -o $@ -
tests/check.c
r7a9d968 r3f44e43 14 14 int sock[2]; 15 15 16 if (socketpair(AF_UNIX, SOCK_STREAM, 0, sock) < 0) {16 if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNIX, sock) < 0) { 17 17 perror("socketpair"); 18 18 return FALSE; -
tests/check_jabber_util.c
r7a9d968 r3f44e43 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) != NULL);39 fail_unless(jabber_buddy_by_jid(ic, "wilmer@gaast.net", GET_BUDDY_EXACT)); 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) != NULL);85 fail_if(jabber_buddy_by_jid(ic, "nekkid@lamejab.net", 0)); 86 86 87 87 /* Fixing a bug in this branch that caused information to get lost when -
unix.c
r7a9d968 r3f44e43 147 147 struct passwd *pw = NULL; 148 148 pw = getpwnam(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)); 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); 160 155 } 161 156 } … … 286 281 static void sighandler_shutdown(int signal) 287 282 { 288 int unused G_GNUC_UNUSED;289 283 /* Write a single null byte to the pipe, just to send a message to the main loop. 290 284 * This gets handled by bitlbee_shutdown (the b_input_add callback for this pipe) */ 291 unused =write(shutdown_pipe.fd[1], "", 1);285 write(shutdown_pipe.fd[1], "", 1); 292 286 } 293 287 … … 298 292 { 299 293 GSList *l; 300 int unused G_GNUC_UNUSED;301 294 const char *message = "ERROR :BitlBee crashed! (SIGSEGV received)\r\n"; 302 295 int len = strlen(message); … … 305 298 irc_t *irc = l->data; 306 299 sock_make_blocking(irc->fd); 307 unused =write(irc->fd, message, len);300 write(irc->fd, message, len); 308 301 } 309 302
Note: See TracChangeset
for help on using the changeset viewer.