aboutsummaryrefslogtreecommitdiffstats
path: root/storage_xml.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2006-06-25 19:23:27 +0200
committerWilmer van der Gaast <wilmer@gaast.net>2006-06-25 19:23:27 +0200
commit88086dbd9002123be39d00c53460f1ec9f2b719a (patch)
tree2370e9c8b59040b16217e120f203d24ff34f9270 /storage_xml.c
parent6e1fed7057ee26f21b0e59a5aeb292d4f3f0e8ae (diff)
Added versioning information to the XML-file (convenient for later format
changes), got rid of confusing "Password successfully changed" message when the user uses the identify-command and protected rc4_decode() against short inputs.
Diffstat (limited to 'storage_xml.c')
-rw-r--r--storage_xml.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/storage_xml.c b/storage_xml.c
index 35d74935..0bbcd99a 100644
--- a/storage_xml.c
+++ b/storage_xml.c
@@ -39,6 +39,7 @@ typedef enum
/* This isn't very clean, probably making a separate error class + code for
BitlBee would be a better solution. But this will work for now... */
#define XML_PASS_ERRORMSG "Wrong username or password"
+#define XML_FORMAT_VERSION 1
struct xml_parsedata
{
@@ -409,7 +410,7 @@ static storage_status_t xml_save( irc_t *irc, int overwrite )
/* Save the hash in base64-encoded form. */
pass_buf = base64_encode( (char*) pass_md5, 21 );
- if( !xml_printf( fd, "<user nick=\"%s\" password=\"%s\">\n", irc->nick, pass_buf ) )
+ if( !xml_printf( fd, "<user nick=\"%s\" password=\"%s\" version=\"%d\">\n", irc->nick, pass_buf, XML_FORMAT_VERSION ) )
goto write_error;
g_free( pass_buf );