Changeset ad46e4d for protocols/jabber


Ignore:
Timestamp:
2011-12-22T11:23:18Z (12 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
d6ddff0
Parents:
f1c870a
Message:

Use initgroups() as well when dropping privileges. Closes bug #852.

Location:
protocols/jabber
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/io.c

    rf1c870a rad46e4d  
    173173        if( st > 0 )
    174174        {
     175                if( jd->flags & JFLAG_MOCK )
     176                        return TRUE;
     177               
    175178                /* Parse. */
    176179                if( xt_feed( jd->xt, buf, st ) < 0 )
  • protocols/jabber/jabber.c

    rf1c870a rad46e4d  
    336336        if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 )
    337337                return jabber_write( ic, message, strlen( message ) );
     338
     339        if( g_strcasecmp( who, JABBER_MOCK_HANDLE ) == 0 )
     340        {
     341                /* Parse. */
     342                if( xt_feed( jd->xt, message, strlen( message ) ) < 0 )
     343                {
     344                        imcb_error( ic, "XML stream error" );
     345                        imc_logout( ic, TRUE );
     346                        return FALSE;
     347                }
     348               
     349                /* Execute all handlers. */
     350                if( !xt_handle( jd->xt, NULL, 1 ) )
     351                {
     352                        /* Don't do anything, the handlers should have
     353                           aborted the connection already. */
     354                        return FALSE;
     355                }
     356        }
    338357       
    339358        if( ( s = strchr( who, '=' ) ) && jabber_chat_by_jid( ic, s + 1 ) )
     
    426445        {
    427446                jd->flags |= JFLAG_XMLCONSOLE;
    428                 imcb_add_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL );
     447                imcb_add_buddy( ic, who, NULL );
     448                return;
     449        }
     450        else if( g_strcasecmp( who, JABBER_MOCK_HANDLE ) == 0 )
     451        {
     452                jd->flags |= JFLAG_MOCK;
     453                imcb_add_buddy( ic, who, NULL );
    429454                return;
    430455        }
     
    446471                imcb_remove_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL );
    447472                */
     473                return;
     474        }
     475        else if( g_strcasecmp( who, JABBER_MOCK_HANDLE ) == 0 )
     476        {
     477                jd->flags &= ~JFLAG_MOCK;
    448478                return;
    449479        }
  • protocols/jabber/jabber.h

    rf1c870a rad46e4d  
    4747        JFLAG_XMLCONSOLE = 64,          /* If the user added an xmlconsole buddy. */
    4848        JFLAG_STARTTLS_DONE = 128,      /* If a plaintext session was converted to TLS. */
     49        JFLAG_MOCK = 256,               /* If the user added a mock buddy. */
    4950} jabber_flags_t;
    5051
     
    188189
    189190#define JABBER_XMLCONSOLE_HANDLE "xmlconsole"
     191#define JABBER_MOCK_HANDLE "mock"
    190192
    191193/* Prefixes to use for packet IDs (mainly for IQ packets ATM). Usually the
Note: See TracChangeset for help on using the changeset viewer.