Author: idra
Date: 2006-01-10 14:21:24 +0000 (Tue, 10 Jan 2006)
New Revision: 12827

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=12827

Log:

This was a very well concealed bug.
Thank to Andrew Bartlet for finding out a test case that showed it up.

Simo.


Modified:
   branches/SAMBA_4_0/source/lib/ldb/common/attrib_handlers.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/common/attrib_handlers.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/common/attrib_handlers.c  2006-01-10 
11:49:50 UTC (rev 12826)
+++ branches/SAMBA_4_0/source/lib/ldb/common/attrib_handlers.c  2006-01-10 
14:21:24 UTC (rev 12827)
@@ -136,8 +136,15 @@
                }
                s1++; s2++;
        }
-       while (*s1 == ' ') s1++;
-       while (*s2 == ' ') s2++;
+       if (! (*s1 && *s2)) {
+               /* remove trailing spaces only if one of the pointers
+                * has reached the end of the strings otherwise we
+                * can mistakenly match.
+                * ex. "domain users" <-> "domainUpdates"
+                */
+               while (*s1 == ' ') s1++;
+               while (*s2 == ' ') s2++;
+       }
        return (int)(toupper(*s1)) - (int)(toupper(*s2));
 }
 

Reply via email to