Changeset 35987a1


Ignore:
Timestamp:
2014-02-28T23:17:28Z (10 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
b4b8f1e
Parents:
2e815e5
Message:

Allow use of "ac x set -del password" to use /oper to change the password
"securely". Patch from Flexo, bug #1117.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • irc.h

    r2e815e5 r35987a1  
    6060        OPER_HACK_IDENTIFY_FORCE  = 0x02100,
    6161        OPER_HACK_REGISTER = 0x200,
    62         OPER_HACK_ACCOUNT_ADD = 0x400,
     62        OPER_HACK_ACCOUNT_PASSWORD = 0x400,
    6363        OPER_HACK_ANY = 0x3700, /* To check for them all at once. */
    6464       
  • irc_commands.c

    r2e815e5 r35987a1  
    433433        /* /OPER can now also be used to enter IM/identify passwords without
    434434           echoing. It's a hack but the extra password security is worth it. */
    435         if( irc->status & OPER_HACK_ACCOUNT_ADD )
     435        if( irc->status & OPER_HACK_ACCOUNT_PASSWORD )
    436436        {
    437437                account_t *a;
  • protocols/account.c

    r2e815e5 r35987a1  
    154154        else if( strcmp( set->key, "password" ) == 0 )
    155155        {
    156                 /* set -del should be allowed now, but I don't want to have any
    157                    NULL pointers to have to deal with. */
    158                 if( !value )
    159                         value = "";
     156                /* set -del allows /oper to be used to change the password or,
     157                   iff oauth is enabled, reset the oauth credential magic.
     158                */
     159                if( !value ) {
     160                        if ( set_getbool( &(acc->set), "oauth" ) ) {
     161                                value = "";
     162                        } else {
     163                                value = PASSWORD_PENDING;
     164                                ((irc_t *)acc->bee->ui_data)->status |= OPER_HACK_ACCOUNT_PASSWORD;
     165                                irc_rootmsg((irc_t *)acc->bee->ui_data, "You may now use /OPER to set the password");
     166                        }
     167                }
    160168               
    161169                g_free( acc->pass );
  • root_commands.c

    r2e815e5 r35987a1  
    422422                                }
    423423                       
    424                         irc->status |= OPER_HACK_ACCOUNT_ADD;
     424                        irc->status |= OPER_HACK_ACCOUNT_PASSWORD;
    425425                }
    426426               
Note: See TracChangeset for help on using the changeset viewer.