]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/getdn.c
Don't provide ldap.OpenLDAP.org and dc=OpenLDAP, dc=Org as the defaults.
[openldap] / libraries / libldap / getdn.c
index 70c09c7933c4c534a50a634345727a604ceb2761..28b5d554bf332281cc205197025097f4ae32ee7c 100644 (file)
@@ -1,4 +1,8 @@
 /*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+/*  Portions
  *  Copyright (c) 1994 Regents of the University of Michigan.
  *  All rights reserved.
  *
@@ -7,10 +11,6 @@
 
 #include "portable.h"
 
-#ifndef lint 
-static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -54,7 +54,7 @@ ldap_dn2ufn( char *dn )
        Debug( LDAP_DEBUG_TRACE, "ldap_dn2ufn\n", 0, 0, 0 );
 
        if ( ldap_is_dns_dn( dn ) || ( p = strchr( dn, '=' )) == NULL )
-               return( strdup( dn ));
+               return( strdup( dn ) );
 
        ufn = strdup( ++p );
 
@@ -124,6 +124,7 @@ ldap_explode_dns( char *dn )
        int     ncomps, maxcomps;
        char    *s;
        char    **rdns;
+       char    *tok_r;
 
        if ( (rdns = (char **) malloc( 8 * sizeof(char *) )) == NULL ) {
                return( NULL );
@@ -131,7 +132,8 @@ ldap_explode_dns( char *dn )
 
        maxcomps = 8;
        ncomps = 0;
-       for ( s = strtok( dn, "@." ); s != NULL; s = strtok( NULL, "@." ) ) {
+       for ( s = ldap_pvt_strtok( dn, "@.", &tok_r ); s != NULL; 
+             s = ldap_pvt_strtok( NULL, "@.", &tok_r ) ) {
                if ( ncomps == maxcomps ) {
                        maxcomps *= 2;
                        if ( (rdns = (char **) realloc( rdns, maxcomps *