]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/ad.c
Fix prev commit, return generated passwd
[openldap] / servers / slapd / ad.c
index 7d83de93303529d6380d7bb2070e3d15297f05a9..db1eb06d2a6038e384e6bd0b75718172cc557ab8 100644 (file)
@@ -1,9 +1,18 @@
+/* ad.c - routines for dealing with attribute descriptions */
 /* $OpenLDAP$ */
-/*
- * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2003 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
  */
-/* ad.c - routines for dealing with attribute descriptions */
 
 #include "portable.h"
 
@@ -222,10 +231,10 @@ int slap_bv2ad(
                                } else if ( rc > 0 ||
                                        ( rc == 0 && (unsigned)optlen > tags[i].bv_len ))
                                {
-                                       AC_MEMCPY( &tags[i+1], &tags[i],
-                                               (ntags-i)*sizeof(struct berval) );
-                                       tags[i].bv_val = opt;
-                                       tags[i].bv_len = optlen;
+                                       AC_MEMCPY( &tags[i+2], &tags[i+1],
+                                               (ntags-i-1)*sizeof(struct berval) );
+                                       tags[i+1].bv_val = opt;
+                                       tags[i+1].bv_len = optlen;
                                        goto done;
                                }
                        }
@@ -518,6 +527,7 @@ int ad_inlist(
                                &attrs->an_desc->ad_tags ) ) {
                                return 1;
                        }
+                       continue;
                }
 
                /*