Changes in / [9b63df6:fd03770]


Ignore:
Files:
30 added
22 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r9b63df6 rfd03770  
    1010
    1111# Program variables
    12 objects = account.o bitlbee.o conf.o crypting.o help.o ini.o ipc.o irc.o irc_commands.o log.o nick.o query.o root_commands.o set.o storage.o storage_text.o unix.o url.o user.o util.o
     12objects = account.o bitlbee.o conf.o crypting.o help.o ipc.o irc.o irc_commands.o log.o nick.o query.o root_commands.o set.o storage.o storage_text.o storage_xml.o unix.o user.o
    1313headers = account.h bitlbee.h commands.h conf.h config.h crypting.h help.h ini.h ipc.h irc.h log.h nick.h query.h set.h sock.h storage.h url.h user.h protocols/http_client.h protocols/md5.h protocols/nogaim.h protocols/proxy.h protocols/sha.h protocols/ssl_client.h
    14 subdirs = protocols
     14subdirs = protocols lib
     15
     16objects += $(LDAP_OBJ)
    1517
    1618# Expansion of variables
  • account.c

    r9b63df6 rfd03770  
    3535        {
    3636                for( a = irc->accounts; a->next; a = a->next );
    37                 a = a->next = g_new0 ( account_t, 1 );
     37                a = a->next = g_new0( account_t, 1 );
    3838        }
    3939        else
     
    4545        a->user = g_strdup( user );
    4646        a->pass = g_strdup( pass );
     47        a->auto_connect = 1;
    4748        a->irc = irc;
    4849       
  • account.h

    r9b63df6 rfd03770  
    3434        char *server;
    3535       
     36        int auto_connect;
    3637        int reconnect;
    3738       
  • bitlbee.c

    r9b63df6 rfd03770  
    291291                        irc_t *irc;
    292292                       
     293                        /* Since we're fork()ing here, let's make sure we won't
     294                           get the same random numbers as the parent/siblings. */
     295                        srand( time( NULL ) ^ getpid() );
     296                       
    293297                        /* Close the listening socket, we're a client. */
    294298                        close( global.listen_socket );
  • bitlbee.h

    r9b63df6 rfd03770  
    130130#include "query.h"
    131131#include "sock.h"
    132 #include "util.h"
     132#include "misc.h"
    133133#include "proxy.h"
    134134
  • conf.c

    r9b63df6 rfd03770  
    3434#include "ipc.h"
    3535
    36 #include "protocols/proxy.h"
     36#include "proxy.h"
    3737
    3838char *CONF_FILE;
     
    5555        conf->nofork = 0;
    5656        conf->verbose = 0;
    57         conf->primary_storage = "text";
     57        conf->primary_storage = "xml";
     58        conf->migrate_storage = g_strsplit( "text", ",", -1 );
    5859        conf->runmode = RUNMODE_INETD;
    5960        conf->authmode = AUTHMODE_OPEN;
  • configure

    r9b63df6 rfd03770  
    3131
    3232events=glib
     33ldap=auto
    3334ssl=auto
    3435
     
    6667
    6768--ipv6=0/1      IPv6 socket support                     $ipv6
     69
     70--ldap=0/1/auto LDAP support                            $ldap
    6871
    6972--events=...    Event handler (glib, libevent)          $events
     
    141144fi
    142145
    143 echo CFLAGS+=-I`pwd` -I`pwd`/protocols -I. >> Makefile.settings
     146echo CFLAGS+=-I`pwd` -I`pwd`/lib -I`pwd`/protocols -I. >> Makefile.settings
    144147
    145148echo CFLAGS+=-DHAVE_CONFIG_H >> Makefile.settings
    146149
    147150if [ -n "$CC" ]; then
    148         echo "CC=$CC" >> Makefile.settings;
     151        CC=$CC
    149152elif type gcc > /dev/null 2> /dev/null; then
    150         echo "CC=gcc" >> Makefile.settings;
     153        CC=gcc
    151154elif type cc > /dev/null 2> /dev/null; then
    152         echo "CC=cc" >> Makefile.settings;
     155        CC=cc
    153156else
    154157        echo 'Cannot find a C compiler, aborting.'
    155158        exit 1;
    156159fi
     160
     161echo "CC=$CC" >> Makefile.settings;
    157162
    158163if [ -n "$LD" ]; then
     
    202207echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings
    203208
     209if [ "$events" = "libevent" ]; then
     210        if ! [ -e "${libevent}include/event.h" ]; then
     211                echo
     212                echo 'Warning: Could not find event.h, you might have to install it and/or specify'
     213                echo 'its location using the --libevent= argument. (Example: If event.h is in'
     214                echo '/usr/local/include and binaries are in /usr/local/lib: --libevent=/usr/local)'
     215        fi
     216       
     217        echo '#define EVENTS_LIBEVENT' >> config.h
     218        cat <<EOF>>Makefile.settings
     219EFLAGS+=-levent -L${libevent}lib
     220CFLAGS+=-I${libevent}include
     221EOF
     222elif [ "$events" = "glib" ]; then
     223        ## We already use glib anyway, so this is all we need (and in fact not even this, but just to be sure...):
     224        echo '#define EVENTS_GLIB' >> config.h
     225else
     226        echo
     227        echo 'ERROR: Unknown event handler specified.'
     228        exit 1
     229fi
     230echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings
     231
    204232detect_gnutls()
    205233{
     
    230258                ret=0;
    231259        fi;
     260}
     261
     262detect_ldap()
     263{
     264        TMPFILE=`mktemp`
     265        if $CC -o $TMPFILE -shared -lldap 2>/dev/null >/dev/null; then
     266                cat<<EOF>>Makefile.settings
     267EFLAGS+=-lldap
     268CFLAGS+=
     269EOF
     270                ldap=1
     271                rm -f $TMPFILE
     272                ret=1
     273        else
     274                ldap=0
     275                ret=0
     276        fi
    232277}
    233278
     
    292337fi
    293338
     339if [ "$ldap" = "auto" ]; then
     340        detect_ldap
     341fi
     342
     343if [ "$ldap" = 0 ]; then
     344        echo "LDAP_OBJ=" >> Makefile.settings
     345        echo "#undef WITH_LDAP" >> config.h
     346elif [ "$ldap" = 1 ]; then
     347        echo "#define WITH_LDAP 1" >> config.h
     348        echo "LDAP_OBJ=storage_ldap.o" >> Makefile.settings
     349fi
     350
    294351if [ "$strip" = 0 ]; then
    295352        echo "STRIP=\# skip strip" >> Makefile.settings;
     
    444501        echo '  Building without IM-protocol support. We wish you a lot of fun...';
    445502fi
     503
     504if [ "$ldap" = "0" ]; then
     505        echo "  LDAP storage backend disabled."
     506else
     507        echo "  LDAP storage backend enabled."
     508fi
  • irc.c

    r9b63df6 rfd03770  
    3333GSList *irc_connection_list = NULL;
    3434
    35 static char *passchange (irc_t *irc, void *set, char *value)
    36 {
    37         irc_setpass (irc, value);
    38         return (NULL);
     35static char *passchange( irc_t *irc, void *set, char *value )
     36{
     37        irc_setpass( irc, value );
     38        irc_usermsg( irc, "Password successfully changed" );
     39        return NULL;
    3940}
    4041
     
    329330void irc_setpass (irc_t *irc, const char *pass)
    330331{
    331         if (irc->password) g_free (irc->password);
     332        g_free (irc->password);
    332333       
    333334        if (pass) {
    334335                irc->password = g_strdup (pass);
    335                 irc_usermsg (irc, "Password successfully changed");
    336336        } else {
    337337                irc->password = NULL;
  • protocols/Makefile

    r9b63df6 rfd03770  
    1010
    1111# [SH] Program variables
    12 objects = $(EVENT_HANDLER) http_client.o md5.o nogaim.o proxy.o sha.o $(SSL_CLIENT)
     12objects = nogaim.o
    1313
    1414# [SH] The next two lines should contain the directory name (in $(subdirs))
  • protocols/nogaim.c

    r9b63df6 rfd03770  
    297297        b_event_remove( gc->keepalive );
    298298        gc->flags |= OPT_LOGGING_OUT;
     299       
    299300        gc->keepalive = 0;
    300301        gc->prpl->close( gc );
  • protocols/yahoo/libyahoo2.c

    r9b63df6 rfd03770  
    8989#define vsnprintf _vsnprintf
    9090#endif
     91
     92#include "base64.h"
    9193
    9294#ifdef USE_STRUCT_CALLBACKS
     
    695697}
    696698
    697 static char base64digits[] =    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    698                                 "abcdefghijklmnopqrstuvwxyz"
    699                                 "0123456789._";
     699/* raw bytes in quasi-big-endian order to base 64 string (NUL-terminated) */
    700700static void to_y64(unsigned char *out, const unsigned char *in, int inlen)
    701 /* raw bytes in quasi-big-endian order to base 64 string (NUL-terminated) */
    702 {
    703         for (; inlen >= 3; inlen -= 3)
    704                 {
    705                         *out++ = base64digits[in[0] >> 2];
    706                         *out++ = base64digits[((in[0]<<4) & 0x30) | (in[1]>>4)];
    707                         *out++ = base64digits[((in[1]<<2) & 0x3c) | (in[2]>>6)];
    708                         *out++ = base64digits[in[2] & 0x3f];
    709                         in += 3;
    710                 }
    711         if (inlen > 0)
    712                 {
    713                         unsigned char fragment;
    714 
    715                         *out++ = base64digits[in[0] >> 2];
    716                         fragment = (in[0] << 4) & 0x30;
    717                         if (inlen > 1)
    718                                 fragment |= in[1] >> 4;
    719                         *out++ = base64digits[fragment];
    720                         *out++ = (inlen < 2) ? '-'
    721                                         : base64digits[(in[1] << 2) & 0x3c];
    722                         *out++ = '-';
    723                 }
    724         *out = '\0';
     701{
     702        base64_encode_real(in, inlen, out, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-");
    725703}
    726704
  • root_commands.c

    r9b63df6 rfd03770  
    139139                break;
    140140        case STORAGE_OK:
    141                 irc_usermsg( irc, "Password accepted" );
     141                irc_usermsg( irc, "Password accepted, settings and accounts loaded" );
    142142                irc_umode_set( irc, "+R", 1 );
    143143                break;
     144        case STORAGE_OTHER_ERROR:
    144145        default:
    145                 irc_usermsg( irc, "Something very weird happened" );
     146                irc_usermsg( irc, "Unknown error while loading configuration" );
    146147                break;
    147148        }
     
    306307                       
    307308                                for( a = irc->accounts; a; a = a->next )
    308                                         if( !a->gc )
     309                                        if( !a->gc && a->auto_connect )
    309310                                                account_on( irc, a );
    310311                        }
  • storage.c

    r9b63df6 rfd03770  
    66
    77/* Support for multiple storage backends */
     8
     9/* Copyright (C) 2005 Jelmer Vernooij <jelmer@samba.org> */
    810
    911/*
     
    2931
    3032extern storage_t storage_text;
     33extern storage_t storage_xml;
    3134
    32 static GList text_entry = { &storage_text, NULL, NULL };
    33 static GList *storage_backends = &text_entry;
     35static GList *storage_backends = NULL;
    3436
    3537void register_storage_backend(storage_t *backend)
     
    6365        int i;
    6466        storage_t *storage;
    65 
     67       
     68        register_storage_backend(&storage_text);
     69        register_storage_backend(&storage_xml);
     70       
    6671        storage = storage_init_single(primary);
    6772        if (storage == NULL)
  • storage.h

    r9b63df6 rfd03770  
    3333        STORAGE_ALREADY_EXISTS,
    3434        STORAGE_OTHER_ERROR /* Error that isn't caused by user input, such as
    35                                                    a database that is unreachable. log() will be
    36                                                    used for the exact error message */
     35                               a database that is unreachable. log() will be
     36                               used for the exact error message */
    3737} storage_status_t;
    3838
  • unix.c

    r9b63df6 rfd03770  
    4848       
    4949        b_main_init();
    50        
    5150        log_init();
    52 
    5351        nogaim_init();
    54 
     52       
     53        srand( time( NULL ) ^ getpid() );
     54       
    5555        CONF_FILE = g_strdup( CONF_FILE_DEF );
    56        
    5756        global.helpfile = g_strdup( HELP_FILE );
    58 
     57       
    5958        global.conf = conf_load( argc, argv );
    6059        if( global.conf == NULL )
    6160                return( 1 );
    62 
    63 
     61       
    6462        if( global.conf->runmode == RUNMODE_INETD )
    6563        {
     
    8987        if( i != 0 )
    9088                return( i );
    91 
     89       
    9290        global.storage = storage_init( global.conf->primary_storage, global.conf->migrate_storage );
    9391        if ( global.storage == NULL) {
Note: See TracChangeset for help on using the changeset viewer.