diff options
| -rw-r--r-- | Makefile | 2 | ||||
| -rwxr-xr-x | configure | 35 | ||||
| -rw-r--r-- | doc/bitlbee.schema | 28 | ||||
| -rw-r--r-- | storage.c | 2 | ||||
| -rw-r--r-- | storage_ldb.c | 63 | 
5 files changed, 130 insertions, 0 deletions
| @@ -13,6 +13,8 @@ objects = account.o bitlbee.o conf.o crypting.o help.o ini.o ipc.o irc.o irc_com  headers = 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  subdirs = protocols +objects += $(LDB_OBJ) +  # Expansion of variables  subdirobjs = $(foreach dir,$(subdirs),$(dir)/$(dir).o)  CFLAGS += -Wall @@ -27,6 +27,7 @@ yahoo=1  debug=0  strip=1  ipv6=1 +ldb=auto  ssl=auto  arch=`uname -s` @@ -63,6 +64,8 @@ Option		Description				Default  --ipv6=0/1	IPv6 socket support			$ipv6 +--ldb=0/1/auto	LDB support				$ldb +  --ssl=...	SSL library to use (gnutls, nss, openssl, bogus, auto)  							$ssl  EOF @@ -220,6 +223,20 @@ EOF  	fi;  } +detect_ldb() +{ +	if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG ldb; then +		cat<<EOF>>Makefile.settings +EFLAGS+=`$PKG_CONFIG --libs ldb` +CFLAGS+=`$PKG_CONFIG --cflags ldb` +EOF +		ldb=1 +		ret=1 +	else +		ret=0 +	fi +} +  if [ "$msn" = 1 -o "$jabber" = 1 ]; then  	if [ "$ssl" = "auto" ]; then  		detect_gnutls @@ -280,6 +297,18 @@ if [ "$msn" = 1 -o "$jabber" = 1 ]; then  	echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings  fi +if [ "$ldb" = "auto" ]; then +	detect_ldb +fi + +if [ "$ldb" = 0 ]; then +	echo "LDB_OBJ=\# no ldb" >> Makefile.settings +	echo "#undef LDB" >> config.h +elif [ "$ldb" = 1 ]; then +	echo "#define LDB 1" >> config.h +	echo "LDB_OBJ=storage_ldb.o" >> Makefile.settings +fi +  if [ "$strip" = 0 ]; then  	echo "STRIP=\# skip strip" >> Makefile.settings;  else @@ -430,3 +459,9 @@ if [ -n "$protocols" ]; then  else  	echo '  Building without IM-protocol support. We wish you a lot of fun...';  fi + +if [ "$ldb" = "0" ]; then +	echo "  LDB storage backend disabled." +else +	echo "  LDB storage backend enabled." +fi diff --git a/doc/bitlbee.schema b/doc/bitlbee.schema new file mode 100644 index 00000000..9fc6895c --- /dev/null +++ b/doc/bitlbee.schema @@ -0,0 +1,28 @@ +## LDAP Schema file for BitlBee +## +## We need the following object classes and related attributes: +## bitlBeeNick: +##  - nick +##  - password +##  - setting (multiple values) +##  +## bitlBeeAccount: +##  - protocol (msn, oscar, jabber, yahoo, ...) +##  - username +##  - password +##  - server name +##  - autoconnect (true/false) +## +## bitlBeeBuddy: +##  - nick +##  - handle + +## each bitlBeeNick has zero or more bitlBeeAccount subentries +## and bitlBeeAccount entries contain zero or more bitlBeeBuddy entries + +## The admin needs to setup the LDAP server to: +## - allow anonymous users to auth against bitlBeeNick objects on the  +##   password field +## - allow anonymous users to create new objects that start with nick= +## - allow read/write for a user that is authenticated only to his/her own  +##   object and subentries @@ -6,6 +6,8 @@  /* Support for multiple storage backends */ +/* Copyright (C) 2005 Jelmer Vernooij <jelmer@samba.org> */ +  /*    This program is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by diff --git a/storage_ldb.c b/storage_ldb.c new file mode 100644 index 00000000..09d1452b --- /dev/null +++ b/storage_ldb.c @@ -0,0 +1,63 @@ +  /********************************************************************\ +  * BitlBee -- An IRC to other IM-networks gateway                     * +  *                                                                    * +  * Copyright 2002-2004 Wilmer van der Gaast and others                * +  \********************************************************************/ + +/* Storage backend that uses the LDB embedded LDAP-like database */ + +/* Copyright (C) 2006 Jelmer Vernooij <jelmer@samba.org> */ + +/* +  This program is free software; you can redistribute it and/or modify +  it under the terms of the GNU General Public License as published by +  the Free Software Foundation; either version 2 of the License, or +  (at your option) any later version. + +  This program is distributed in the hope that it will be useful, +  but WITHOUT ANY WARRANTY; without even the implied warranty of +  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the +  GNU General Public License for more details. + +  You should have received a copy of the GNU General Public License with +  the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL; +  if not, write to the Free Software Foundation, Inc., 59 Temple Place, +  Suite 330, Boston, MA  02111-1307  USA +*/ + +#define BITLBEE_CORE +#include "bitlbee.h" +#include <ldb.h> + +static void sldb_init (void) +{ +} + +static storage_status_t sldb_load ( const char *my_nick, const char* password, irc_t *irc ) +{ +	return STORAGE_OK; +} + +static storage_status_t sldb_save( irc_t *irc, int overwrite ) +{ +	return STORAGE_OK; +} + +static storage_status_t sldb_check_pass( const char *nick, const char *password ) +{ +	return STORAGE_OK; +} + +static storage_status_t sldb_remove( const char *nick, const char *password ) +{ +	return STORAGE_OK; +} + +storage_t storage_ldb = { +	.name = "ldb", +	.init = sldb_init, +	.check_pass = sldb_check_pass, +	.remove = sldb_remove, +	.load = sldb_load, +	.save = sldb_save +}; | 
