[Pidgin] #6620: Jabber client doesn't support spaces in user names

Pidgin trac at pidgin.im
Mon Aug 18 18:46:27 EDT 2008


#6620: Jabber client doesn't support spaces in user names
------------------------------------+---------------------------------------
 Reporter:  not_a_commie            |     Owner:  lschiere
     Type:  defect                  |    Status:  new     
Component:  unclassified            |   Version:  2.4.3   
 Keywords:  jabber username spaces  |  
------------------------------------+---------------------------------------
 Pidgin fails to authenticate with a Jabber server when entering a username
 with spaces in it.  I’ve looked up the code where this happens and found
 the following in jutil.c:

 gboolean jabber_nodeprep_validate(const char *str)
 {
                 const char *c;

                 if(!str)
                                 return TRUE;



                if(strlen(str) > 1023)
                                 return FALSE;

                 c = str;
                 while(c && *c) {
                                gunichar ch = g_utf8_get_char(c);
                                 if(ch == '\"' || ch == '&' || ch == '\''
 || ch == '/' || ch == ':' ||
                                                                 ch == '<'
 || ch == '>' || ch == '@' || !g_unichar_isgraph(ch)) {
                                                 return FALSE;
                                 }
                                 c = g_utf8_next_char(c);
                 }
                 return TRUE;
 }

 The part that fails is the call to g_unichar_isgraph which returns false
 if the character is not printable *or* a space.  There is a related
 function called g_unichar_isprint which is the same with the exception
 that it allows spaces.  I propose that Pidgin uses g_unichar_isprint
 instead.

 http://www.gtk.org/api/2.6/glib/glib-Unicode-Manipulation.html#g-unichar-
 isgraph

 http://www.gtk.org/api/2.6/glib/glib-Unicode-Manipulation.html#g-unichar-
 isprint

-- 
Ticket URL: <http://developer.pidgin.im/ticket/6620>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list