Changeset 50bb490


Ignore:
Timestamp:
2016-03-25T18:07:53Z (9 years ago)
Author:
Dennis Kaarsemaker <dennis@…>
Branches:
master
Children:
64b4263
Parents:
a6005da
git-author:
Dennis Kaarsemaker <dennis@…> (23-02-16 19:14:57)
git-committer:
Dennis Kaarsemaker <dennis@…> (25-03-16 18:07:53)
Message:

ldap authentication backend

We only support the openldap scheme for now, with users that are
posixAccounts. Moreover, as the plugin cannot be configured directly,
you must configure libldap correctly in /etc/openldap/ldap.conf

Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • .travis.yml

    ra6005da r50bb490  
    33
    44script:
    5  - ./configure --pam=1
     5 - ./configure --pam=1 --ldap=1
    66 - make check
    77 - BITLBEE_SKYPE=plugin dpkg-buildpackage -uc -us -d
     
    3030    - check
    3131    - libpam0g-dev
     32    - libldap2-dev
    3233  coverity_scan:
    3334    project:
     
    3536      description: "An IRC to other chat networks gateway"
    3637    notification_email: dx@dxzone.com.ar
    37     build_command_prepend: ./configure --otr=1 --debug=1 --pam=1
     38    build_command_prepend: ./configure --otr=1 --debug=1 --pam=1 --ldap=1
    3839    build_command: make
    3940    branch_pattern: coverity_scan
  • auth.c

    ra6005da r50bb490  
    44#ifdef WITH_PAM
    55extern auth_backend_t auth_pam;
     6#endif
     7#ifdef WITH_LDAP
     8extern auth_backend_t auth_ldap;
    69#endif
    710
     
    1316        gl = g_list_append(gl, &auth_pam);
    1417        if (backend && !strcmp(backend, "pam")) {
     18                ok = 1;
     19        }
     20#endif
     21#ifdef WITH_LDAP
     22        gl = g_list_append(gl, &auth_ldap);
     23        if (backend && !strcmp(backend, "ldap")) {
    1524                ok = 1;
    1625        }
  • bitlbee.conf

    ra6005da r50bb490  
    6666## - storage (internal storage)
    6767## - pam (Linux PAM authentication)
     68## - ldap (LDAP server configured in the openldap settings)
    6869#
    6970# AuthBackend = storage
  • conf.c

    ra6005da r50bb490  
    245245                                if (g_strcasecmp(ini->value, "storage") == 0) {
    246246                                        conf->auth_backend = NULL;
    247                                 } else if (g_strcasecmp(ini->value, "pam") == 0) {
     247                                } else if (g_strcasecmp(ini->value, "pam") == 0 ||
     248                                         g_strcasecmp(ini->value, "ldap") == 0) {
    248249                                        g_free(conf->auth_backend);
    249250                                        conf->auth_backend = g_strdup(ini->value);
  • configure

    ra6005da r50bb490  
    5353
    5454pam=0
     55ldap=0
    5556
    5657pie=1
     
    137138
    138139--pam=0/1       Disable/enable PAM authentication       $pam
     140--ldap=0/1      Disable/enable LDAP authentication      $ldap
    139141
    140142--doc=0/1       Disable/enable help.txt generation      $doc
     
    645647        authobjs=$authobjs'auth_pam.o '
    646648        authlibs=$authlibs'-lpam '
     649fi
     650if [ "$ldap" = 0 ]; then
     651        echo '#undef WITH_LDAP' >> config.h
     652else
     653        if ! echo '#include <ldap.h>' | $CC -E - >/dev/null 2>/dev/null; then
     654                echo 'Cannot find libldap development libraries, aborting. (Install libldap2-dev?)'
     655                exit 1
     656        fi
     657        echo '#define WITH_LDAP' >> config.h
     658        authobjs=$authobjs'auth_ldap.o '
     659        authlibs=$authlibs'-lldap '
    647660fi
    648661echo AUTH_OBJS=$authobjs >> Makefile.settings
  • tests/Makefile

    ra6005da r50bb490  
    1515distclean: clean
    1616
    17 main_objs = bitlbee.o conf.o dcc.o help.o ipc.o irc.o irc_cap.o irc_channel.o irc_commands.o irc_im.o irc_send.o irc_user.o irc_util.o irc_commands.o log.o nick.o query.o root_commands.o set.o storage.o storage_xml.o auth.o auth_pam.o
     17main_objs = bitlbee.o conf.o dcc.o help.o ipc.o irc.o irc_cap.o irc_channel.o irc_commands.o irc_im.o irc_send.o irc_user.o irc_util.o irc_commands.o log.o nick.o query.o root_commands.o set.o storage.o storage_xml.o auth.o auth_pam.o auth_ldap.o
    1818
    1919test_objs = check.o check_util.o check_nick.o check_md5.o check_arc.o check_irc.o check_help.o check_user.o check_set.o check_jabber_sasl.o check_jabber_util.o
Note: See TracChangeset for help on using the changeset viewer.