]> granicus.if.org Git - sudo/commitdiff
For conversion to a sudoers parse tree, ldap_entry_compare() now
authorTodd C. Miller <Todd.Miller@sudo.ws>
Thu, 30 Aug 2018 13:48:16 +0000 (07:48 -0600)
committerTodd C. Miller <Todd.Miller@sudo.ws>
Thu, 30 Aug 2018 13:48:16 +0000 (07:48 -0600)
needs to sort in ascending order, not descending.  Bug #849

plugins/sudoers/ldap.c

index 03691eaff7331fe93e5d0496e94948b475f9f88d..bcf13442163b4edd27f19f59c1ff92eb5fe4fe16 100644 (file)
@@ -1724,7 +1724,8 @@ done:
 }
 
 /*
- * Comparison function for ldap_entry_wrapper structures, descending order.
+ * Comparison function for ldap_entry_wrapper structures, ascending order.
+ * This should match role_order_cmp() in parse_ldif.c.
  */
 static int
 ldap_entry_compare(const void *a, const void *b)
@@ -1733,8 +1734,8 @@ ldap_entry_compare(const void *a, const void *b)
     const struct ldap_entry_wrapper *bw = b;
     debug_decl(ldap_entry_compare, SUDOERS_DEBUG_LDAP)
 
-    debug_return_int(bw->order < aw->order ? -1 :
-       (bw->order > aw->order ? 1 : 0));
+    debug_return_int(aw->order < bw->order ? -1 :
+       (aw->order > bw->order ? 1 : 0));
 }
 
 /*