From 43fece89c9f878bad95b7f41f38a95692643b541 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jorge=20Rodr=C3=ADguez?= Date: Thu, 4 Oct 2007 20:36:21 +0200 Subject: [PATCH] Filter tag for retrieving LDAP entries. Insert POD in Vcard2Ldap. --- include/v2l_config.h | 2 +- patch/patch-v2l-jabberd-2.1.14.diff | 219 ++++++++++++++++++++++-------------- src/v2l_config.c | 6 +- src/v2l_conn.c | 209 +++++++++++++++++++++------------- tools/Vcard2Ldap.pm | 58 +++++++++- tools/jabber2db.pl | 6 +- v2l-j143.xml | 2 +- v2l-j16.xml.in | 2 +- v2l-j2.xml | 2 +- 9 files changed, 329 insertions(+), 177 deletions(-) diff --git a/include/v2l_config.h b/include/v2l_config.h index 42cd540..2103c6b 100644 --- a/include/v2l_config.h +++ b/include/v2l_config.h @@ -49,9 +49,9 @@ typedef struct v2l_Config char *host; /*!< LDAP hostname */ int port; /*!< LDAP port */ char *suffix; /*!< LDAP root dn */ - char *uniqattr; /*!< unique attr used to retrieve/set objects */ char *binddn; /*!< dn used for "master" connections */ char *bindpw; /*!< pw used for "master" connections */ + char *filter; /*!< LDAP search filter */ char *confpath; /*!< path to the translation template */ } v2l_Config; diff --git a/patch/patch-v2l-jabberd-2.1.14.diff b/patch/patch-v2l-jabberd-2.1.14.diff index c9c6f41..30956a2 100644 --- a/patch/patch-v2l-jabberd-2.1.14.diff +++ b/patch/patch-v2l-jabberd-2.1.14.diff @@ -302,7 +302,7 @@ diff -Naurb jabberd-2.1.14.orig/sm/mod_iq_vcard.c jabberd-2.1.14/sm/mod_iq_vcard DLLEXPORT int module_init(mod_instance_t mi, char *arg) { diff -Naurb jabberd-2.1.14.orig/sm/v2l_config.c jabberd-2.1.14/sm/v2l_config.c --- jabberd-2.1.14.orig/sm/v2l_config.c 1970-01-01 01:00:00.000000000 +0100 -+++ jabberd-2.1.14/sm/v2l_config.c 2007-09-26 23:51:26.000000000 +0200 ++++ jabberd-2.1.14/sm/v2l_config.c 2007-10-04 19:12:20.000000000 +0200 @@ -0,0 +1,176 @@ +/* + * This program is free software; you can redistribute it and/or modify @@ -389,11 +389,11 @@ diff -Naurb jabberd-2.1.14.orig/sm/v2l_config.c jabberd-2.1.14/sm/v2l_config.c + return 0; + } + -+ self->uniqattr = _v2l_config_get_tag (conn_base, "uniqattr"); ++ self->filter = _v2l_config_get_tag (conn_base, "filter"); + -+ if (self->uniqattr == NULL) ++ if (self->filter == NULL) + { -+ log_error (ZONE, "LDAP unique attribute is not specified"); ++ log_error (ZONE, "LDAP search filter is not specified"); + return 0; + } + @@ -482,7 +482,7 @@ diff -Naurb jabberd-2.1.14.orig/sm/v2l_config.c jabberd-2.1.14/sm/v2l_config.c +} diff -Naurb jabberd-2.1.14.orig/sm/v2l_config.h jabberd-2.1.14/sm/v2l_config.h --- jabberd-2.1.14.orig/sm/v2l_config.h 1970-01-01 01:00:00.000000000 +0100 -+++ jabberd-2.1.14/sm/v2l_config.h 2007-09-27 01:05:30.000000000 +0200 ++++ jabberd-2.1.14/sm/v2l_config.h 2007-10-04 19:11:46.000000000 +0200 @@ -0,0 +1,73 @@ +/* + * This program is free software; you can redistribute it and/or modify @@ -535,9 +535,9 @@ diff -Naurb jabberd-2.1.14.orig/sm/v2l_config.h jabberd-2.1.14/sm/v2l_config.h + char *host; /*!< LDAP hostname */ + int port; /*!< LDAP port */ + char *suffix; /*!< LDAP root dn */ -+ char *uniqattr; /*!< unique attr used to retrieve/set objects */ + char *binddn; /*!< dn used for "master" connections */ + char *bindpw; /*!< pw used for "master" connections */ ++ char *filter; /*!< LDAP search filter */ + char *confpath; /*!< path to the translation template */ +} v2l_Config; + @@ -559,8 +559,8 @@ diff -Naurb jabberd-2.1.14.orig/sm/v2l_config.h jabberd-2.1.14/sm/v2l_config.h +#endif diff -Naurb jabberd-2.1.14.orig/sm/v2l_conn.c jabberd-2.1.14/sm/v2l_conn.c --- jabberd-2.1.14.orig/sm/v2l_conn.c 1970-01-01 01:00:00.000000000 +0100 -+++ jabberd-2.1.14/sm/v2l_conn.c 2007-09-28 15:14:18.000000000 +0200 -@@ -0,0 +1,875 @@ ++++ jabberd-2.1.14/sm/v2l_conn.c 2007-10-04 20:29:08.000000000 +0200 +@@ -0,0 +1,924 @@ +/* + * 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 @@ -621,15 +621,19 @@ diff -Naurb jabberd-2.1.14.orig/sm/v2l_conn.c jabberd-2.1.14/sm/v2l_conn.c +static v2l_LdapConn *_v2l_create_conn (char *host, int port, const char *binddn, + const char *user, const char *passwd, int expire); + -+/*! \brief Gets user password -+ Retrieves user password from LDAP directory using master connection. -+ \note Allocated memory must be freed by the caller. ++/*! \brief Gets user credentials ++ Retrieves user password and common name from LDAP directory using master ++ connection. ++ \note Allocated memory (*passwd and *cn) must be freed by the caller. + \param self Module config. + \param user User name. ++ \param[out] passwd User password. ++ \param[out] cn Common Name. + \pre self is valid, user is not NULL -+ \return user password string or NULL if doesn't exist or error. ++ \return 1 if no error, otherwise 0. +*/ -+static char *_v2l_ldap_get_passwd (v2l_Config *self, const char *user); ++static int _v2l_ldap_get_credentials(v2l_Config *self, const char *user, ++ char **passwd, char **cn); + +/*! \brief Closes and frees a connection. + Utility function, common code for two hash walker functions. @@ -668,6 +672,15 @@ diff -Naurb jabberd-2.1.14.orig/sm/v2l_conn.c jabberd-2.1.14/sm/v2l_conn.c +static int _v2l_ldap_search (char *dn, char *suffix, char **attrs, int subtree, + v2l_LdapEvt *evt_res); + ++/*! \brief Builds and returns the search filter ++ \note Allocated memory must be freed by the caller. ++ \param self Module config. ++ \param user User name. ++ \sa _v2l_ldap_search ++ \return The filter or NULL if error. ++*/ ++static char *_v2l_ldap_filter (v2l_Config *self, const char *user); ++ +/*! \brief Waits for LDAP results. + Operations on the directory are asynchronous. This is a sync wait function. + \param \param[in,out] evt_res Control and info parameter. @@ -743,29 +756,26 @@ diff -Naurb jabberd-2.1.14.orig/sm/v2l_conn.c jabberd-2.1.14/sm/v2l_conn.c + + if(user_conn == NULL) + { -+ char *passwd, *binddn; ++ char *passwd, *cn, *binddn; + + /* Get the user password for connecting him to LDAP server */ -+ passwd = _v2l_ldap_get_passwd (self, user); -+ -+ /* user exists? */ -+ if (passwd == NULL) ++ if (_v2l_ldap_get_credentials (self, user, &passwd, &cn) == 0) + { + log_error (ZONE, "User \"%s\" not found in the directory", user); + return NULL; + } + -+ binddn = (char *) malloc (sizeof(char) * (strlen (self->suffix) + -+ strlen (self->uniqattr) + strlen (user) + 3)); ++ binddn = (char *) malloc (strlen (self->suffix) + strlen (cn) + 4); + + if (binddn == NULL) + { + LOG_ERROR_MEM; + free (passwd); ++ free (cn); + return NULL; + } + -+ sprintf (binddn, "%s=%s,%s", self->uniqattr, user, self->suffix); ++ sprintf (binddn, "cn=%s,%s", cn, self->suffix); + + log_debug (ZONE, "Attempting to connect with DN: %s", binddn); + @@ -773,6 +783,7 @@ diff -Naurb jabberd-2.1.14.orig/sm/v2l_conn.c jabberd-2.1.14/sm/v2l_conn.c + passwd, 1); + + free (passwd); ++ free (cn); + free (binddn); + + } /* user_conn == NULL */ @@ -1074,84 +1085,122 @@ diff -Naurb jabberd-2.1.14.orig/sm/v2l_conn.c jabberd-2.1.14/sm/v2l_conn.c +} + +static char * -+_v2l_ldap_get_passwd(v2l_Config *self, const char *user) ++_v2l_ldap_filter (v2l_Config *self, const char *user) +{ -+ LDAPMessage *e; -+ v2l_LdapEvt *evt_res; -+ char *data, *filter, **vals, *attrs[2] = {"userPassword", NULL}; ++ char *filter; + -+ evt_res = (v2l_LdapEvt *) malloc(sizeof(v2l_LdapEvt)); ++ filter = (char *) malloc (strlen (self->filter) + strlen (user)); + -+ if (evt_res == NULL) -+ { -+ LOG_ERROR_MEM; -+ return NULL; -+ } ++ if (filter == NULL) ++ { ++ LOG_ERROR_MEM; ++ return NULL; ++ } + -+ filter = (char *) malloc (strlen (self->uniqattr) + strlen (user) + 2); ++ sprintf(filter, self->filter, user); + -+ if (filter == NULL) -+ { -+ LOG_ERROR_MEM; -+ free (evt_res); -+ return NULL; -+ } ++ return filter; ++} + -+ sprintf(filter, "%s=%s", self->uniqattr, user); -+ evt_res->ld = self->master_conn->ld; ++static int ++_v2l_ldap_get_credentials (v2l_Config *self, const char *user, char **passwd, ++ char **cn) ++{ ++ LDAPMessage *e; ++ v2l_LdapEvt *evt_res; ++ char *filter, **vpw, **vcn; ++ char *attrs[3] = {"userPassword", "cn", NULL}; + -+ evt_res->rc = _v2l_ldap_search (filter, self->suffix, attrs, 0, evt_res); -+ free (filter); ++ evt_res = (v2l_LdapEvt *) malloc(sizeof(v2l_LdapEvt)); + -+ if (evt_res->rc != LDAP_SUCCESS) -+ { -+ log_error(ZONE, -+ "LDAP error attempting to retrieve \"%s\"'s password: %s", -+ user, ldap_err2string (evt_res->rc)); -+ free (evt_res); -+ return NULL; -+ } ++ if (evt_res == NULL) ++ { ++ LOG_ERROR_MEM; ++ return 0; ++ } + -+ _v2l_ldap_sync (evt_res); -+ data = NULL; ++ filter = _v2l_ldap_filter (self, user); + -+ if (ldap_count_entries(evt_res->ld, evt_res->result) == 1) -+ { -+ e = ldap_first_entry(evt_res->ld, evt_res->result); -+ vals = ldap_get_values(evt_res->ld, e, "userPassword"); -+ -+ if (vals == NULL) -+ { -+ log_debug(ZONE, "User has no password!"); -+ data = (char *) malloc(sizeof(char)); -+ -+ if (data == NULL) -+ { -+ LOG_ERROR_MEM; -+ ldap_msgfree(evt_res->result); -+ free(evt_res); -+ return NULL; -+ } -+ -+ data[0] = 0; -+ } -+ else -+ { -+ data = (char *) malloc(sizeof(char) * (strlen(vals[0]) + 1)); ++ evt_res->ld = self->master_conn->ld; ++ evt_res->rc = _v2l_ldap_search (filter, self->suffix, attrs, 0, evt_res); ++ ++ free (filter); ++ ++ if (evt_res->rc != LDAP_SUCCESS) ++ { ++ log_error(ZONE, ++ "LDAP error attempting to retrieve \"%s\"'s password: %s", ++ user, ldap_err2string (evt_res->rc)); ++ free (evt_res); ++ return 0; ++ } + -+ if (data != NULL) -+ { -+ strcpy(data, vals[0]); -+ } ++ _v2l_ldap_sync (evt_res); + -+ ldap_value_free(vals); -+ } ++ *passwd = NULL; ++ *cn = NULL; + -+ ldap_msgfree(evt_res->result); -+ } ++ if (ldap_count_entries(evt_res->ld, evt_res->result) == 1) ++ { ++ e = ldap_first_entry(evt_res->ld, evt_res->result); ++ ++ vpw = ldap_get_values (evt_res->ld, e, "userPassword"); ++ ++ if (vpw == NULL) ++ { ++ log_debug (ZONE, "User has no password!"); ++ ldap_msgfree (evt_res->result); ++ free (evt_res); ++ return 0; ++ } ++ ++ vcn = ldap_get_values (evt_res->ld, e, "cn"); ++ ++ if (vcn == NULL) ++ { ++ log_debug (ZONE, "LDAP general failure!!"); ++ ldap_value_free (vpw); ++ ldap_msgfree (evt_res->result); ++ free (evt_res); ++ return 0; ++ } ++ ++ *passwd = (char *) malloc (strlen(vpw[0]) + 1); ++ ++ if (*passwd == NULL) ++ { ++ LOG_ERROR_MEM; ++ ldap_value_free (vpw); ++ ldap_value_free (vcn); ++ ldap_msgfree (evt_res->result); ++ free (evt_res); ++ return 0; ++ } ++ ++ strcpy (*passwd, vpw[0]); ++ ldap_value_free (vpw); ++ ++ *cn = (char *) malloc (strlen(vcn[0]) + 1); ++ ++ if (*cn == NULL) ++ { ++ LOG_ERROR_MEM; ++ free (*passwd); ++ ldap_value_free (vpw); ++ ldap_value_free (vcn); ++ ldap_msgfree (evt_res->result); ++ free (evt_res); ++ return 0; ++ } ++ ++ strcpy (*cn, vcn[0]); ++ ldap_value_free (vcn); ++ } ++ ++ ldap_msgfree (evt_res->result); ++ free (evt_res); + -+ free(evt_res); -+ return data; ++ return *passwd != NULL && *cn != NULL; +} + +static int diff --git a/src/v2l_config.c b/src/v2l_config.c index c62f835..f9fb12c 100644 --- a/src/v2l_config.c +++ b/src/v2l_config.c @@ -83,11 +83,11 @@ v2l_config_init (v2l_Config *self, T_CONF cfgroot) return 0; } - self->uniqattr = _v2l_config_get_tag (conn_base, "uniqattr"); + self->filter = _v2l_config_get_tag (conn_base, "filter"); - if (self->uniqattr == NULL) + if (self->filter == NULL) { - log_error (ZONE, "LDAP unique attribute is not specified"); + log_error (ZONE, "LDAP search filter is not specified"); return 0; } diff --git a/src/v2l_conn.c b/src/v2l_conn.c index 9c12497..a4b9c2b 100644 --- a/src/v2l_conn.c +++ b/src/v2l_conn.c @@ -58,15 +58,19 @@ static xht V2L_CONN_LIST = NULL; static v2l_LdapConn *_v2l_create_conn (char *host, int port, const char *binddn, const char *user, const char *passwd, int expire); -/*! \brief Gets user password - Retrieves user password from LDAP directory using master connection. - \note Allocated memory must be freed by the caller. +/*! \brief Gets user credentials + Retrieves user password and common name from LDAP directory using master + connection. + \note Allocated memory (*passwd and *cn) must be freed by the caller. \param self Module config. \param user User name. + \param[out] passwd User password. + \param[out] cn Common Name. \pre self is valid, user is not NULL - \return user password string or NULL if doesn't exist or error. + \return 1 if no error, otherwise 0. */ -static char *_v2l_ldap_get_passwd (v2l_Config *self, const char *user); +static int _v2l_ldap_get_credentials(v2l_Config *self, const char *user, + char **passwd, char **cn); /*! \brief Closes and frees a connection. Utility function, common code for two hash walker functions. @@ -105,6 +109,15 @@ static int _v2l_ldap_modify (char *dn, LDAPMod **attrs, v2l_LdapEvt *evt_res); static int _v2l_ldap_search (char *dn, char *suffix, char **attrs, int subtree, v2l_LdapEvt *evt_res); +/*! \brief Builds and returns the search filter + \note Allocated memory must be freed by the caller. + \param self Module config. + \param user User name. + \sa _v2l_ldap_search + \return The filter or NULL if error. +*/ +static char *_v2l_ldap_filter (v2l_Config *self, const char *user); + /*! \brief Waits for LDAP results. Operations on the directory are asynchronous. This is a sync wait function. \param \param[in,out] evt_res Control and info parameter. @@ -180,29 +193,26 @@ v2l_get_conn (v2l_Config *self, const char *user) if(user_conn == NULL) { - char *passwd, *binddn; + char *passwd, *cn, *binddn; /* Get the user password for connecting him to LDAP server */ - passwd = _v2l_ldap_get_passwd (self, user); - - /* user exists? */ - if (passwd == NULL) + if (_v2l_ldap_get_credentials (self, user, &passwd, &cn) == 0) { log_error (ZONE, "User \"%s\" not found in the directory", user); return NULL; } - binddn = (char *) malloc (sizeof(char) * (strlen (self->suffix) + - strlen (self->uniqattr) + strlen (user) + 3)); + binddn = (char *) malloc (strlen (self->suffix) + strlen (cn) + 4); if (binddn == NULL) { LOG_ERROR_MEM; free (passwd); + free (cn); return NULL; } - sprintf (binddn, "%s=%s,%s", self->uniqattr, user, self->suffix); + sprintf (binddn, "cn=%s,%s", cn, self->suffix); log_debug (ZONE, "Attempting to connect with DN: %s", binddn); @@ -210,6 +220,7 @@ v2l_get_conn (v2l_Config *self, const char *user) passwd, 1); free (passwd); + free (cn); free (binddn); } /* user_conn == NULL */ @@ -511,84 +522,122 @@ _v2l_create_conn (char *host, int port, const char *binddn, const char *user, } static char * -_v2l_ldap_get_passwd(v2l_Config *self, const char *user) +_v2l_ldap_filter (v2l_Config *self, const char *user) { - LDAPMessage *e; - v2l_LdapEvt *evt_res; - char *data, *filter, **vals, *attrs[2] = {"userPassword", NULL}; + char *filter; - evt_res = (v2l_LdapEvt *) malloc(sizeof(v2l_LdapEvt)); + filter = (char *) malloc (strlen (self->filter) + strlen (user)); - if (evt_res == NULL) - { - LOG_ERROR_MEM; - return NULL; - } + if (filter == NULL) + { + LOG_ERROR_MEM; + return NULL; + } - filter = (char *) malloc (strlen (self->uniqattr) + strlen (user) + 2); + sprintf(filter, self->filter, user); - if (filter == NULL) - { - LOG_ERROR_MEM; - free (evt_res); - return NULL; - } + return filter; +} - sprintf(filter, "%s=%s", self->uniqattr, user); - evt_res->ld = self->master_conn->ld; +static int +_v2l_ldap_get_credentials (v2l_Config *self, const char *user, char **passwd, + char **cn) +{ + LDAPMessage *e; + v2l_LdapEvt *evt_res; + char *filter, **vpw, **vcn; + char *attrs[3] = {"userPassword", "cn", NULL}; - evt_res->rc = _v2l_ldap_search (filter, self->suffix, attrs, 0, evt_res); - free (filter); + evt_res = (v2l_LdapEvt *) malloc(sizeof(v2l_LdapEvt)); - if (evt_res->rc != LDAP_SUCCESS) - { - log_error(ZONE, - "LDAP error attempting to retrieve \"%s\"'s password: %s", - user, ldap_err2string (evt_res->rc)); - free (evt_res); - return NULL; - } + if (evt_res == NULL) + { + LOG_ERROR_MEM; + return 0; + } - _v2l_ldap_sync (evt_res); - data = NULL; + filter = _v2l_ldap_filter (self, user); - if (ldap_count_entries(evt_res->ld, evt_res->result) == 1) - { - e = ldap_first_entry(evt_res->ld, evt_res->result); - vals = ldap_get_values(evt_res->ld, e, "userPassword"); - - if (vals == NULL) - { - log_debug(ZONE, "User has no password!"); - data = (char *) malloc(sizeof(char)); - - if (data == NULL) - { - LOG_ERROR_MEM; - ldap_msgfree(evt_res->result); - free(evt_res); - return NULL; - } - - data[0] = 0; - } - else - { - data = (char *) malloc(sizeof(char) * (strlen(vals[0]) + 1)); - - if (data != NULL) - { - strcpy(data, vals[0]); - } - - ldap_value_free(vals); - } - - ldap_msgfree(evt_res->result); - } + evt_res->ld = self->master_conn->ld; + evt_res->rc = _v2l_ldap_search (filter, self->suffix, attrs, 0, evt_res); + + free (filter); + + if (evt_res->rc != LDAP_SUCCESS) + { + log_error(ZONE, + "LDAP error attempting to retrieve \"%s\"'s password: %s", + user, ldap_err2string (evt_res->rc)); + free (evt_res); + return 0; + } + + _v2l_ldap_sync (evt_res); + + *passwd = NULL; + *cn = NULL; + + if (ldap_count_entries(evt_res->ld, evt_res->result) == 1) + { + e = ldap_first_entry(evt_res->ld, evt_res->result); + + vpw = ldap_get_values (evt_res->ld, e, "userPassword"); + + if (vpw == NULL) + { + log_debug (ZONE, "User has no password!"); + ldap_msgfree (evt_res->result); + free (evt_res); + return 0; + } + + vcn = ldap_get_values (evt_res->ld, e, "cn"); + + if (vcn == NULL) + { + log_debug (ZONE, "LDAP general failure!!"); + ldap_value_free (vpw); + ldap_msgfree (evt_res->result); + free (evt_res); + return 0; + } + + *passwd = (char *) malloc (strlen(vpw[0]) + 1); + + if (*passwd == NULL) + { + LOG_ERROR_MEM; + ldap_value_free (vpw); + ldap_value_free (vcn); + ldap_msgfree (evt_res->result); + free (evt_res); + return 0; + } + + strcpy (*passwd, vpw[0]); + ldap_value_free (vpw); + + *cn = (char *) malloc (strlen(vcn[0]) + 1); + + if (*cn == NULL) + { + LOG_ERROR_MEM; + free (*passwd); + ldap_value_free (vpw); + ldap_value_free (vcn); + ldap_msgfree (evt_res->result); + free (evt_res); + return 0; + } + + strcpy (*cn, vcn[0]); + ldap_value_free (vcn); + } + + ldap_msgfree (evt_res->result); + free (evt_res); - free(evt_res); - return data; + return *passwd != NULL && *cn != NULL; } static int diff --git a/tools/Vcard2Ldap.pm b/tools/Vcard2Ldap.pm index c85e7e9..474175b 100644 --- a/tools/Vcard2Ldap.pm +++ b/tools/Vcard2Ldap.pm @@ -1,14 +1,68 @@ package Vcard2Ldap; +=head1 NAME + +Vcard2Ldap - Stuff for convert LDAP entries to Jabberd roster ones. + +=head1 SYNOPSIS + + use Vcard2Ldap; + my $ldap = Vcard2Ldap::ldap_open (); + my $users = Vcard2Ldap::jabber_get_users ($ldap); + #... + +=head1 DESCRIPTION + +This module isn't intend for general usage, it was made for the sole purpose of +working together with vcard2ldap jabberd module. + +See http://repo.or.cz/w/vcard2ldap.git for details. + +=head2 GLOBALS + +=over 12 + +List of global variables. + +=item C<$jabberd> + +The jabberd server hostname + +=item C<$groupname> + +The name of the roster group where jids will be stored. + +=head2 FUNCTIONS + +List of public functions. + +=item C + +Open connection. Returns a LDAP handler. + +=item C + +Returns a list of records: {jid,group} + +=item C + +Returns a jid from an LDAP entry. + +=item C + +Returns the "vCard map". This hash maps XML vCard tags to LDAP attributes. + +=cut + #### CONFIG my $vcardtpl = "../ldap/vcard.xml"; -our $jabberd = "ferrita"; #"jabber.domain.com"; +our $jabberd = "jabber.domain.com"; our $groupname = "Iris"; my $basedn = "dc=nodomain"; my $ldapserver = "localhost"; my $disname="cn=admin,dc=nodomain"; -my $ldappass= "lilo"; # "secret"; +my $ldappass= "secret"; my $ldapperson = "irisPerson"; my $ldapgroup = "ou"; diff --git a/tools/jabber2db.pl b/tools/jabber2db.pl index 061c254..dfedaa8 100755 --- a/tools/jabber2db.pl +++ b/tools/jabber2db.pl @@ -3,8 +3,8 @@ #### CONFIG my $db = "Pg"; # Pg : PostgresSQL, mysql: MySQL... -my $dbuser = "jorge"; # "jabber"; -my $dbpass = "lilo"; # "secret"; +my $dbuser = "jabber"; +my $dbpass = "secret"; my $dbname = "jabberd2"; ########################## @@ -98,7 +98,7 @@ sub usage { } sub set_all_vcards { - db_delete_vcards () if $option_populate; + db_delete_vcards () if $option_populate; foreach (Vcard2Ldap::ldap_get_users ($ldap)) { db_set_vcard ($_); diff --git a/v2l-j143.xml b/v2l-j143.xml index 537266c..44fab54 100644 --- a/v2l-j143.xml +++ b/v2l-j143.xml @@ -9,11 +9,11 @@ localhost dc=nodomain - cn cn=admin,dc=nodomain secret dc=nodomain ./vcard2ldap/ldap/vcard.xml + cn=%s ./spool diff --git a/v2l-j16.xml.in b/v2l-j16.xml.in index 50e3fcf..5990a52 100644 --- a/v2l-j16.xml.in +++ b/v2l-j16.xml.in @@ -9,11 +9,11 @@ localhost dc=nodomain - cn cn=admin,dc=nodomain secret dc=nodomain @sysconfdir@/vcard2ldap/ldap/vcard.xml + cn=%s ./spool diff --git a/v2l-j2.xml b/v2l-j2.xml index 904a4f5..e584f13 100644 --- a/v2l-j2.xml +++ b/v2l-j2.xml @@ -4,10 +4,10 @@ localhost dc=nodomain - cn cn=admin,dc=nodomain secret dc=nodomain ./vcard2ldap/ldap/vcard.xml + cn=%s -- 2.11.4.GIT