]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9763 Maintain values in order of insertion
authorOndřej Kuzník <ondra@mistotebe.net>
Wed, 8 Dec 2021 17:14:50 +0000 (17:14 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 12 Jan 2022 21:59:12 +0000 (21:59 +0000)
servers/slapd/overlays/refint.c

index e8e14236ada303ef82a78cfe2f93e3c07995bd87..75d036035dd17591f199caaa659672d647c3c122 100644 (file)
@@ -257,8 +257,11 @@ refint_cf_gen(ConfigArgs *c)
                                        ip = ch_malloc (
                                                sizeof ( refint_attrs ) );
                                        ip->attr = ad;
-                                       ip->next = dd->attrs;
-                                       dd->attrs = ip;
+
+                                       for ( pipp = &dd->attrs; *pipp; pipp = &(*pipp)->next )
+                                               /* Get to the end */ ;
+                                       ip->next = *pipp;
+                                       *pipp = ip;
                                } else {
                                        snprintf( c->cr_msg, sizeof( c->cr_msg ),
                                                "%s <%s>: %s", c->argv[0], c->argv[i], text );