bug-anubis
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-anubis] [patch] eat whitespace after : in ident reply


From: Brian Dessent
Subject: [bug-anubis] [patch] eat whitespace after : in ident reply
Date: Wed, 06 Apr 2005 01:29:50 -0700

When the ident server replies with e.g. 

1313, 24 : USERID : UNIX : brian

...the function ident_extract_username() is used to extract the username
part from after the colon.  The current implementation fills in
'username' with everything after the :, including the space.

This later results in a call to e.g. getpwnam(" brian") which on my
system fails despite a user "brian" existing.  The attached patch eats
any spaces after the colon before the username.

Brian

-----

2005-04-06  Brian Dessent  address@hidden

        * ident.c (ident_extract_username): Do not return a username
        with leading spaces.
--- ident.c.orig        2005-04-06 01:20:14.062500000 -0700
+++ ident.c     2005-04-05 21:02:43.531250000 -0700
@@ -56,6 +56,8 @@ ident_extract_username (char *reply, cha
   p++;
   if (strlen (p) >= size)
     return 1;
+  while(*p == ' ')
+    p++;
   strcpy (username, p);
   return 0;
 }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]