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

Pidgin trac at pidgin.im
Tue Aug 19 14:02:37 EDT 2008


#6620: Jabber client doesn't support spaces in user names
------------------------------------+---------------------------------------
 Reporter:  not_a_commie            |        Owner:  seanegan   
     Type:  defect                  |       Status:  new        
Milestone:                          |    Component:  Google Talk
  Version:  2.4.3                   |   Resolution:             
 Keywords:  jabber username spaces  |  
------------------------------------+---------------------------------------
Description changed by not_a_commie:

Old description:

> 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
>

> I should add that Skype doesn't have this problem with spaces and
> usernames with spaces are quite common on NT domains, which usernames are
> often used for authentication with Skype.

New description:

 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


 I should add that Openfire/Spark doesn't have this problem with spaces and
 usernames with spaces are quite common on NT domains, which usernames are
 often used for authentication with Openfire.

--

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


More information about the Tracker mailing list