Hi,
* Franziska Lichtblau <[email protected]> [2012-06-16 18:46]:
> first of all thank you for the patch, I think it's a good idea and will
> forward it to upstream as well. 
> Sorry for the long time since you sent the patch - hopefully won't happen
> again. 
[...] 
> Debian123! being the password. 
> Could you maybe just change the output funktion to display ***** instead of
> the actual password?

Sure, an updated version of the patch is attached. I'm using this patch btw 
since I reported the bug, without problems so far.

Cheers
Nico
-- 
Nico Golde - http://www.ngolde.de - [email protected] - GPG: 0xA0A0AAAA
For security reasons, all text in this mail is double-rot13 encrypted.
diff -Nurad mcabber-0.10.1/mcabber/commands.c mcabber-0.10.1.new/mcabber/commands.c
--- mcabber-0.10.1/mcabber/commands.c	2010-12-01 21:51:20.000000000 +0100
+++ mcabber-0.10.1.new/mcabber/commands.c	2012-06-17 14:08:06.647247157 +0200
@@ -2918,7 +2918,7 @@
 static void room_bookmark(gpointer bud, char *arg)
 {
   const char *roomid;
-  const char *name = NULL, *nick = NULL;
+  const char *name = NULL, *nick = NULL, *passwd = NULL;
   char *tmpnick = NULL;
   enum room_autowhois autowhois = 0;
   enum room_printstatus printstatus = 0;
@@ -2931,7 +2931,8 @@
     char **paramlst;
     char **pp;
 
-    paramlst = split_arg(arg, 3, 0); // At most 3 parameters
+    paramlst = split_arg(arg, 4, 0); // At most 4 parameters
+
     for (pp = paramlst; *pp; pp++) {
       if (!strcasecmp(*pp, "add"))
         action = bm_add;
@@ -2943,9 +2944,11 @@
         autojoin = 1;
       else if (!strcmp(*pp, "-"))
         nick_set = 1;
-      else {
+      else if(nick_set == 0){
         nick_set = 1;
         nick = tmpnick = to_utf8 (*pp);
+      } else if(nick_set == 1){
+       passwd = to_utf8(*pp);
       }
     }
     free_arg_lst(paramlst);
@@ -2961,7 +2964,7 @@
     autowhois   = buddy_getautowhois(bud);
   }
 
-  xmpp_set_storage_bookmark(roomid, name, nick, NULL, autojoin,
+  xmpp_set_storage_bookmark(roomid, name, nick, passwd, autojoin,
                             printstatus, autowhois);
   g_free (tmpnick);
 }
@@ -2988,11 +2991,15 @@
                     (bm_elt->autojoin ? '*' : ' '), bm_elt->roomjid);
     if (bm_elt->nick)
       g_string_append_printf(sbuf, " (%s)", bm_elt->nick);
+    if (bm_elt->passwd)
+      /* replace password for security reasons */
+      g_string_append_printf(sbuf, " (*****)");
     if (bm_elt->name)
       g_string_append_printf(sbuf, " %s", bm_elt->name);
     g_free(bm_elt->roomjid);
     g_free(bm_elt->name);
     g_free(bm_elt->nick);
+    g_free(bm_elt->passwd);
     g_free(bm_elt);
     scr_WriteIncomingMessage(NULL, sbuf->str,
                              0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0);
diff -Nurad mcabber-0.10.1/mcabber/xmpp.c mcabber-0.10.1.new/mcabber/xmpp.c
--- mcabber-0.10.1/mcabber/xmpp.c	2010-12-01 21:51:21.000000000 +0100
+++ mcabber-0.10.1.new/mcabber/xmpp.c	2012-06-17 14:08:06.647247157 +0200
@@ -2083,7 +2083,7 @@
     // If the node is a conference item, let's add the note to our list.
     if (x->name && !strcmp(x->name, "conference")) {
       struct bookmark *bm_elt;
-      const char *autojoin, *name, *nick;
+      const char *autojoin, *name, *nick, *passwd;
       const char *fjid = lm_message_node_get_attribute(x, "jid");
       if (!fjid)
         continue;
@@ -2092,10 +2092,13 @@
       autojoin = lm_message_node_get_attribute(x, "autojoin");
       nick = lm_message_node_get_child_value(x, "nick");
       name = lm_message_node_get_attribute(x, "name");
+      passwd = lm_message_node_get_child_value(x, "password");
       if (autojoin && !strcmp(autojoin, "1"))
         bm_elt->autojoin = 1;
       if (nick)
         bm_elt->nick = g_strdup(nick);
+      if (nick)
+        bm_elt->passwd = g_strdup(passwd);
       if (name)
         bm_elt->name = g_strdup(name);
       sl_bookmarks = g_slist_append(sl_bookmarks, bm_elt);
diff -Nurad mcabber-0.10.1/mcabber/xmpp.h mcabber-0.10.1.new/mcabber/xmpp.h
--- mcabber-0.10.1/mcabber/xmpp.h	2010-12-01 21:51:21.000000000 +0100
+++ mcabber-0.10.1.new/mcabber/xmpp.h	2012-06-17 14:08:06.647247157 +0200
@@ -24,6 +24,7 @@
   gchar *roomjid;
   gchar *name;
   gchar *nick;
+  gchar *passwd;
   guint autojoin;
   /* enum room_printstatus pstatus; */
   /* enum room_autowhois awhois; */

Attachment: pgphjHGRqKe3y.pgp
Description: PGP signature

Reply via email to