Changeset c821e8a


Ignore:
Timestamp:
2008-06-02T12:58:57Z (11 years ago)
Author:
ulim <a.sporto+bee@…>
Branches:
master
Children:
3355a82
Parents:
cce0450 (diff), de8e584 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merged in upstream r384. No conflicts.

Files:
12 edited

Legend:

Unmodified
Added
Removed
  • bitlbee.c

    rcce0450 rc821e8a  
    5454        ;
    5555
    56         i = getaddrinfo( global.conf->iface, global.conf->port, &hints, &addrinfo_bind );
     56        i = getaddrinfo( global.conf->iface_in, global.conf->port, &hints, &addrinfo_bind );
    5757        if( i )
    5858        {
    5959                log_message( LOGLVL_ERROR, "Couldn't parse address `%s': %s",
    60                                            global.conf->iface, gai_strerror(i) );
     60                                           global.conf->iface_in, gai_strerror(i) );
    6161                return -1;
    6262        }
  • bitlbee.conf

    rcce0450 rc821e8a  
    1010##
    1111##  Inetd -- Run from inetd (default)
    12 ##  Daemon -- Run as a stand-alone daemon -- EXPERIMENTAL! BitlBee is not yet
    13 ##    stable enough to serve lots of users from one process. Because of this
    14 ##    and other reasons, the use of daemon-mode is *STRONGLY* discouraged,
    15 ##    don't even *think* of reporting bugs when you use this.
     12##  Daemon -- Run as a stand-alone daemon, serving all users from one process.
     13##    This saves memory if there are more users, the downside is that when one
     14##    user hits a crash-bug, all other users will also lose their connection.
    1615##  ForkDaemon -- Run as a stand-alone daemon, but keep all clients in separate
    1716##    child processes. This should be pretty safe and reliable to use instead
     
    3433# DaemonInterface = 0.0.0.0
    3534# DaemonPort = 6667
     35
     36## ClientInterface:
     37##
     38## If for any reason, you want BitlBee to use a specific address/interface
     39## for outgoing traffic (IM connections, HTTP(S), etc.), set it here.
     40##
     41# ClientInterface = 0.0.0.0
    3642
    3743## AuthMode
  • conf.c

    rcce0450 rc821e8a  
    4545        conf = g_new0( conf_t, 1 );
    4646       
    47         conf->iface = NULL;
     47        conf->iface_in = NULL;
     48        conf->iface_out = NULL;
    4849        conf->port = g_strdup( "6667" );
    4950        conf->nofork = 0;
     
    8384                if( opt == 'i' )
    8485                {
    85                         conf->iface = g_strdup( optarg );
     86                        conf->iface_in = g_strdup( optarg );
    8687                }
    8788                else if( opt == 'p' )
     
    132133                                "\n"
    133134                                "  -I  Classic/InetD mode. (Default)\n"
    134                                 "  -D  Daemon mode. (Still EXPERIMENTAL!)\n"
     135                                "  -D  Daemon mode. (one process serves all)\n"
    135136                                "  -F  Forking daemon. (one process per client)\n"
    136137                                "  -u  Run daemon as specified user.\n"
     
    203204                        else if( g_strcasecmp( ini->key, "daemoninterface" ) == 0 )
    204205                        {
    205                                 g_free( conf->iface );
    206                                 conf->iface = g_strdup( ini->value );
     206                                g_free( conf->iface_in );
     207                                conf->iface_in = g_strdup( ini->value );
    207208                        }
    208209                        else if( g_strcasecmp( ini->key, "daemonport" ) == 0 )
     
    210211                                g_free( conf->port );
    211212                                conf->port = g_strdup( ini->value );
     213                        }
     214                        else if( g_strcasecmp( ini->key, "clientinterface" ) == 0 )
     215                        {
     216                                g_free( conf->iface_out );
     217                                conf->iface_out = g_strdup( ini->value );
    212218                        }
    213219                        else if( g_strcasecmp( ini->key, "authmode" ) == 0 )
  • conf.h

    rcce0450 rc821e8a  
    3232typedef struct conf
    3333{
    34         char *iface;
     34        char *iface_in, *iface_out;
    3535        char *port;
    3636        int nofork;
  • debian/changelog

    rcce0450 rc821e8a  
    11bitlbee (1.2-4) unstable; urgency=low
    22
    3   * Not a real release, just a placeholder for the changelog.
    43  * Fixed init script to use the BITLBEE_OPTS variable, not an undefined
    5     DAEMON_OPT.
     4    DAEMON_OPT. (Closes: #474583)
    65  * Added dependency information to the init script. (Closes: #472567)
    7 
    8  -- Wilmer van der Gaast <wilmer@gaast.net>  Sat, 29 Mar 2008 21:10:33 +0000
     6  * Added bitlbee-dev package. Patch from RISKO Gergely <risko@debian.org>
     7    with some small modifications. (Closes: #473480)
     8
     9 -- Wilmer van der Gaast <wilmer@gaast.net>  Wed, 07 May 2008 22:40:40 -0700
    910
    1011bitlbee (1.2-3) unstable; urgency=low
  • debian/control

    rcce0450 rc821e8a  
    1212 This program can be used as an IRC server which forwards everything you
    1313 say to people on other chat networks: Jabber, ICQ, AIM, MSN and Yahoo.
     14
     15Package: bitlbee-dev
     16Architecture: all
     17Depends: bitlbee (= ${binary:Version})
     18Description: An IRC to other chat networks gateway
     19 This program can be used as an IRC server which forwards everything you
     20 say to people on other chat networks: Jabber, ICQ, AIM, MSN and Yahoo.
     21 .
     22 This package holds development stuff for compiling plug-ins.
  • debian/rules

    rcce0450 rc821e8a  
    1313build-arch: build-arch-stamp
    1414build-arch-stamp:
    15         if [ ! -d debian ]; then exit 1; fi
     15        [ -d debian ]
    1616        ./configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent
    1717        $(MAKE)
     
    2020
    2121clean:
    22         if [ "`whoami`" != "root" -o ! -d debian ]; then exit 1; fi
    23         rm -rf build-arch-stamp debian/bitlbee debian/*.substvars debian/files
     22        [ "`whoami`" = "root" -a -d debian ]
     23        rm -rf build-arch-stamp debian/bitlbee debian/*.substvars debian/files debian/bitlbee-dev
    2424        -$(MAKE) distclean
    2525#       -$(MAKE) -C doc/ clean
     
    2727
    2828install-arch: build-arch
    29         if [ "`whoami`" != "root" -o ! -d debian ]; then exit 1; fi
     29        [ "`whoami`" = "root" -a -d debian ]
    3030        mkdir -p debian/bitlbee/DEBIAN/
    3131        $(MAKE) install install-etc DESTDIR=`pwd`/debian/bitlbee
     
    3535        cp doc/user-guide/user-guide.html debian/bitlbee/usr/share/doc/bitlbee/
    3636
     37install-indep: install-arch
     38        [ "`whoami`" = "root" -a -d debian ]
     39        mkdir -p debian/bitlbee-dev/DEBIAN/
     40        $(MAKE) install-dev DESTDIR=`pwd`/debian/bitlbee-dev
     41
     42        mkdir -p debian/bitlbee-dev/usr/share/doc/bitlbee-dev/
     43
    3744binary-arch: build-arch install-arch
    38         if [ "`whoami`" != "root" -o ! -d debian ]; then exit 1; fi
     45        [ "`whoami`" = "root" -a -d debian ]
    3946
    4047        chmod 755 debian/post* debian/pre* debian/config debian/bitlbee.init
     
    5259                        doc/bitlbee/examples/* man/man8/bitlbee.8 man/man5/bitlbee.conf.5
    5360       
    54         chown -R root.root debian/bitlbee/
     61        chown -R root:root debian/bitlbee/
    5562        find debian/bitlbee/usr/share/ -type d -exec chmod 755 {} \;
    5663        find debian/bitlbee/usr/share/ -type f -exec chmod 644 {} \;
     
    7784        dpkg --build debian/bitlbee ..
    7885
    79 debug-build:
    80         BITLBEE_VERSION=\"`date +%Y%m%d`-`hostname`-debug\" debian/rules clean binary DEBUG=1
     86binary-indep: install-indep
     87        [ "`whoami`" = "root" -a -d debian ]
    8188
    82 binary: binary-arch
     89        chown -R root.root debian/bitlbee-dev/
     90        find debian/bitlbee-dev/usr/share/ -type d -exec chmod 755 {} \;
     91        find debian/bitlbee-dev/usr/share/ -type f -exec chmod 644 {} \;
     92
     93        cp debian/changelog debian/bitlbee-dev/usr/share/doc/bitlbee-dev/changelog.Debian
     94        gzip -9 debian/bitlbee-dev/usr/share/doc/bitlbee-dev/changelog.Debian
     95        cp debian/copyright debian/bitlbee-dev/usr/share/doc/bitlbee-dev/copyright
     96
     97        cd debian/bitlbee-dev; \
     98                find usr -type f -exec md5sum {} \; > DEBIAN/md5sums
     99
     100        dpkg-gencontrol -ldebian/changelog -isp -pbitlbee-dev -Pdebian/bitlbee-dev
     101
     102        dpkg --build debian/bitlbee-dev ..
     103
     104binary: binary-arch binary-indep
    83105build: build-arch
    84 install: install-arch
     106install: install-arch install-indep
    85107
    86 .PHONY: build-arch build clean binary-arch binary install-arch install
     108.PHONY: build-arch build clean binary-arch binary install-arch install binary-indep install-indep
  • doc/README

    rcce0450 rc821e8a  
    5656a package from your distro would've been a better idea. :-P)
    5757
     58Note that the BitlBee code is getting stable enough for daemon mode to be
     59useful. Some public servers use it, and it saves a lot of memory by serving
     60tens of users from a single process. One crash affects all users, but these
     61are becoming quite rare.
     62
    5863
    5964DEPENDENCIES
     
    98103versions of make, we'd love to hear it, but it seems this just isn't
    99104possible.
    100 
    101 
    102 RUNNING ON SERVERS WITH MANY USERS
    103 ==================================
    104 
    105 BitlBee is not yet bug-free. Sometimes a bug causes the program to get into
    106 an infinite loop. Something you really don't want on a public server,
    107 especially when that machine is also used for other (mission-critical) things.
    108 For now we can't do much about it. We haven't seen that happen for a long
    109 time already on our own machines, but some people still manage to get
    110 themselves in nasty situations we haven't seen before.
    111 
    112 For now the best we can offer against this problem is bitlbeed, which allows
    113 you to setrlimit() the child processes to use no more than a specified
    114 number of CPU seconds. Not the best solution (not really a solution anyway),
    115 but certainly trashing one busy daemon process is better than trashing your
    116 whole machine.
    117 
    118 We don't believe adding a limit for bitlbee to /etc/security/limits.conf will
    119 work, because that file is only read by PAM (ie just for real login users,
    120 not daemons).
    121 
    122 See utils/bitlbeed.c for more information about the program.
    123 
    124 Just a little note: Now that we reach version 1.0, this shouldn't be that
    125 much of an issue anymore. However, on a public server, especially if you
    126 also use it for other things, it can't hurt to protect yourself against
    127 possible problems.
    128105
    129106
  • doc/bitlbee.8

    rcce0450 rc821e8a  
    4444
    4545\fBbitlbee\fP should be called by
    46 .BR inetd (8).
    47 (Or \fBbitlbeed\fP,
    48 if you can't run and/or configure \fBinetd\fP.) There is an experimental
    49 daemon mode too, in which BitlBee will serve all clients in one process
    50 (and does not require inetd), but this mode is still experimental.
    51 There are still some bugs left in BitlBee, and if they cause a crash,
    52 that would terminate the BitlBee connection for all clients.
     46.BR inetd (8),
     47or you can run it as a stand-alone daemon.
    5348.PP
    5449.SH OPTIONS
     
    6257Run in daemon mode. In this mode, BitlBee forks to the background and
    6358waits for new connections. All clients will be served from one process.
    64 This is still experimental. See the note above for more information.
    6559.IP "-F"
    6660Run in ForkDaemon mode. This is similar to ordinary daemon mode, but every
    67 client gets its own process. Easier to set up than inetd mode, but without
     61client gets its own process. Easier to set up than inetd mode, and without
    6862the possible stability issues.
    6963.IP "-i \fIaddress\fP"
  • lib/proxy.c

    rcce0450 rc821e8a  
    114114{
    115115        struct sockaddr_in *sin;
     116        struct sockaddr_in me;
    116117        int fd = -1;
    117118
     
    127128
    128129        sock_make_nonblocking(fd);
     130       
     131        if( global.conf->iface_out )
     132        {
     133                me.sin_family = AF_INET;
     134                me.sin_port = 0;
     135                me.sin_addr.s_addr = inet_addr( global.conf->iface_out );
     136               
     137                if( bind( fd, (struct sockaddr *) &me, sizeof( me ) ) != 0 )
     138                        event_debug( "bind( %d, \"%s\" ) failure\n", fd, global.conf->iface_out );
     139        }
    129140       
    130141        event_debug("proxy_connect_none( \"%s\", %d ) = %d\n", host, port, fd);
  • protocols/msn/ns.c

    rcce0450 rc821e8a  
    178178                       
    179179                        debug( "Connecting to a new switchboard with key %s", cmd[5] );
    180                         sb = msn_sb_create( ic, server, port, cmd[5], MSN_SB_NEW );
     180
     181                        if( ( sb = msn_sb_create( ic, server, port, cmd[5], MSN_SB_NEW ) ) == NULL )
     182                        {
     183                                /* Although this isn't strictly fatal for the NS connection, it's
     184                                   definitely something serious (we ran out of file descriptors?). */
     185                                imcb_error( ic, "Could not create new switchboard" );
     186                                imc_logout( ic, TRUE );
     187                                return( 0 );
     188                        }
    181189                       
    182190                        if( md->msgq )
     
    468476                debug( "Got a call from %s (session %d). Key = %s", cmd[5], session, cmd[4] );
    469477               
    470                 sb = msn_sb_create( ic, server, port, cmd[4], session );
    471                 sb->who = g_strdup( cmd[5] );
     478                if( ( sb = msn_sb_create( ic, server, port, cmd[4], session ) ) == NULL )
     479                {
     480                        /* Although this isn't strictly fatal for the NS connection, it's
     481                           definitely something serious (we ran out of file descriptors?). */
     482                        imcb_error( ic, "Could not create new switchboard" );
     483                        imc_logout( ic, TRUE );
     484                        return( 0 );
     485                }
     486                else
     487                {
     488                        sb->who = g_strdup( cmd[5] );
     489                }
    472490        }
    473491        else if( strcmp( cmd[0], "ADD" ) == 0 )
  • root_commands.c

    rcce0450 rc821e8a  
    422422                else
    423423                        acc_handle = g_strdup( cmd[2] );
     424               
     425                if( !acc_handle )
     426                {
     427                        irc_usermsg( irc, "Not enough parameters given (need %d)", 3 );
     428                        return;
     429                }
    424430               
    425431                if( ( tmp = strchr( acc_handle, '/' ) ) )
Note: See TracChangeset for help on using the changeset viewer.