aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/io.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-12-16 21:02:16 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2010-12-16 21:02:16 +0000
commitfe79f7a75d455c6ebf49b5da9f4d6aa905d44294 (patch)
treeda695403789784fddc439bb7d9391cdbfae38208 /protocols/jabber/io.c
parentc5920df89b2e407b63e3a7e6825b2ed68ab96af2 (diff)
Hide password information during SASL auth in xmlconsole.
Diffstat (limited to 'protocols/jabber/io.c')
-rw-r--r--protocols/jabber/io.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/protocols/jabber/io.c b/protocols/jabber/io.c
index d6f92a5f..9170f036 100644
--- a/protocols/jabber/io.c
+++ b/protocols/jabber/io.c
@@ -46,9 +46,16 @@ int jabber_write( struct im_connection *ic, char *buf, int len )
if( jd->flags & JFLAG_XMLCONSOLE )
{
- char *msg;
+ char *msg, *s;
msg = g_strdup_printf( "TX: %s", buf );
+ /* Don't include auth info in XML logs. */
+ if( strncmp( msg, "TX: <auth ", 10 ) == 0 && ( s = strchr( msg, '>' ) ) )
+ {
+ s++;
+ while( *s && *s != '<' )
+ *(s++) = '*';
+ }
imcb_buddy_msg( ic, JABBER_XMLCONSOLE_HANDLE, msg, 0, 0 );
g_free( msg );
}