]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/add.c
Add pointer to an existing document since the netscape.com URLs are dead.
[openldap] / servers / slapd / add.c
index 3fb10969e14f83b2f394619486c3870a44c4dd8d..8d22d54afc255c11b7a4279192511b2cc75d4713 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2006 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -608,10 +608,9 @@ int slap_add_opattrs(
                }
                ptr = ber_bvchr( &csn, '#' );
                if ( ptr ) {
-                       timestamp.bv_len = ptr - csn.bv_val;
-                       if ( timestamp.bv_len >= sizeof(timebuf) )      /* ?!? */
-                               timestamp.bv_len = sizeof(timebuf) - 1;
+                       timestamp.bv_len = STRLENOF("YYYYMMDDHHMMSSZ");
                        AC_MEMCPY( timebuf, csn.bv_val, timestamp.bv_len );
+                       timebuf[timestamp.bv_len-1] = 'Z';
                        timebuf[timestamp.bv_len] = '\0';
                } else {
                        time_t now = slap_get_time();