Changeset 8e6ecfe for root_commands.c


Ignore:
Timestamp:
2016-03-25T18:07:53Z (3 years ago)
Author:
Dennis Kaarsemaker <dennis@…>
Branches:
master
Children:
a6005da
Parents:
446a23e
git-author:
Dennis Kaarsemaker <dennis@…> (23-02-16 18:41:34)
git-committer:
Dennis Kaarsemaker <dennis@…> (25-03-16 18:07:53)
Message:

Authentication: scaffolding for multiple authentication backends

Instead of always putting users passwords in XML files, allow site
admins to configure a different authentication method to integrate
authentication with other systems.

This doesn't add any authentication backends yet, merely the
scaffolding. Notably:

  • Password checking and loading/removing from storage has been decoupled. A new auth_check_pass function is used to check passwords. It does check against the configured storage first, but will handle the authentication backends as well. The XML storage merely signals that a user's password should be checked using an authentication backend.
  • If unknown-to-bitlbee users identify using an authentication backend, they are automatically registered.
  • If an authentication backend is used, that fact is stored in the XML file, the password is not. Passwords are also stored unencrypted in this case, as the password used to encrypt them can change underneath us.
  • configure and Makefile changes for the backend objects
File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    r446a23e r8e6ecfe  
    143143        }
    144144
    145         if (load) {
     145        status = auth_check_pass(irc, irc->user->nick, password);
     146        if (load && (status == STORAGE_OK)) {
    146147                status = storage_load(irc, password);
    147         } else {
    148                 status = storage_check_pass(irc->user->nick, password);
    149148        }
    150149
     
    159158                irc_rootmsg(irc, "Password accepted%s",
    160159                            load ? ", settings and accounts loaded" : "");
    161                 irc_setpass(irc, password);
    162160                irc->status |= USTATUS_IDENTIFIED;
    163161                irc_umode_set(irc, "+R", 1);
     
    268266        storage_status_t status;
    269267
    270         status = storage_remove(irc->user->nick, cmd[1]);
     268        status = auth_check_pass(irc, irc->user->nick, cmd[1]);
     269        if (status == STORAGE_OK) {
     270                status = storage_remove(irc->user->nick);
     271        }
     272
    271273        switch (status) {
    272274        case STORAGE_NO_SUCH_USER:
Note: See TracChangeset for help on using the changeset viewer.