Changeset a6005da


Ignore:
Timestamp:
2016-03-25T18:07:53Z (3 years ago)
Author:
Dennis Kaarsemaker <dennis@…>
Branches:
master
Children:
50bb490
Parents:
8e6ecfe
git-author:
Dennis Kaarsemaker <dennis@…> (23-02-16 18:52:32)
git-committer:
Dennis Kaarsemaker <dennis@…> (25-03-16 18:07:53)
Message:

Linux pam authentication backend

This backend authenticates users against pam.

Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • .travis.yml

    r8e6ecfe ra6005da  
    33
    44script:
    5  - ./configure
     5 - ./configure --pam=1
    66 - make check
    77 - BITLBEE_SKYPE=plugin dpkg-buildpackage -uc -us -d
     
    2929    - libpurple-dev
    3030    - check
     31    - libpam0g-dev
    3132  coverity_scan:
    3233    project:
     
    3435      description: "An IRC to other chat networks gateway"
    3536    notification_email: dx@dxzone.com.ar
    36     build_command_prepend: ./configure --otr=1 --debug=1
     37    build_command_prepend: ./configure --otr=1 --debug=1 --pam=1
    3738    build_command: make
    3839    branch_pattern: coverity_scan
  • auth.c

    r8e6ecfe ra6005da  
    11#define BITLBEE_CORE
    22#include "bitlbee.h"
     3
     4#ifdef WITH_PAM
     5extern auth_backend_t auth_pam;
     6#endif
    37
    48GList *auth_init(const char *backend)
     
    610        GList *gl = NULL;
    711        int ok = backend ? 0 : 1;
     12#ifdef WITH_PAM
     13        gl = g_list_append(gl, &auth_pam);
     14        if (backend && !strcmp(backend, "pam")) {
     15                ok = 1;
     16        }
     17#endif
    818
    919        return ok ? gl : NULL;
  • bitlbee.conf

    r8e6ecfe ra6005da  
    6161## accounts people create to be stored in plain text instead of encrypted with
    6262## their bitlbee password.
     63##
     64## Currently available backends:
     65##
     66## - storage (internal storage)
     67## - pam (Linux PAM authentication)
    6368#
    6469# AuthBackend = storage
  • conf.c

    r8e6ecfe ra6005da  
    245245                                if (g_strcasecmp(ini->value, "storage") == 0) {
    246246                                        conf->auth_backend = NULL;
     247                                } else if (g_strcasecmp(ini->value, "pam") == 0) {
     248                                        g_free(conf->auth_backend);
     249                                        conf->auth_backend = g_strdup(ini->value);
    247250                                } else {
    248251                                        fprintf(stderr, "Invalid %s value: %s\n", ini->key, ini->value);
  • configure

    r8e6ecfe ra6005da  
    5252ssl=auto
    5353
     54pam=0
     55
    5456pie=1
    5557
     
    133135--purple=0/1    Disable/enable libpurple support        $purple
    134136                (automatically disables other protocol modules)
     137
     138--pam=0/1       Disable/enable PAM authentication       $pam
    135139
    136140--doc=0/1       Disable/enable help.txt generation      $doc
     
    631635authobjs=
    632636authlibs=
     637if [ "$pam" = 0 ]; then
     638        echo '#undef WITH_PAM' >> config.h
     639else
     640        if ! echo '#include <security/pam_appl.h>' | $CC -E - >/dev/null 2>/dev/null; then
     641                echo 'Cannot find libpam development libraries, aborting. (Install libpam0g-dev?)'
     642                exit 1
     643        fi
     644        echo '#define WITH_PAM' >> config.h
     645        authobjs=$authobjs'auth_pam.o '
     646        authlibs=$authlibs'-lpam '
     647fi
    633648echo AUTH_OBJS=$authobjs >> Makefile.settings
    634649echo EFLAGS+=$authlibs >> Makefile.settings
  • tests/Makefile

    r8e6ecfe ra6005da  
    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
     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
    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.