X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fdn.c;h=d60edd0cec6e60234a63e36e5f65289d14802a83;hb=966616b274d24c45b1f3a71ff35ddd502153b4a1;hp=c01a8c9620c88035e6549e98fbf61bbf588be524;hpb=cc3615314b0f78aaf41fe79be721dac3490ba585;p=openldap diff --git a/libraries/libldap/dn.c b/libraries/libldap/dn.c index c01a8c9620..d60edd0cec 100644 --- a/libraries/libldap/dn.c +++ b/libraries/libldap/dn.c @@ -1,6 +1,7 @@ /* dn.c - routines for dealing with distinguished names */ +/* $OpenLDAP$ */ /* - * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ @@ -8,7 +9,6 @@ #include -#include #include #include #include @@ -216,25 +216,7 @@ ldap_dn_parent( } /* - * no =, assume it is a dns name, like blah@some.domain.name - * if the blah@ part is there, return some.domain.name. if - * it's just some.domain.name, return domain.name. - */ - if ( strchr( dn, '=' ) == NULL ) { - if ( (s = strchr( dn, '@' )) == NULL ) { - if ( (s = strchr( dn, '.' )) == NULL ) { - return( NULL ); - } - } - if ( *(s + 1) == '\0' ) { - return( NULL ); - } else { - return( LDAP_STRDUP( &s[1] ) ); - } - } - - /* - * else assume it is an X.500-style name, which looks like + * assume it is an X.500-style name, which looks like * foo=bar,sha=baz,... */ @@ -262,7 +244,7 @@ ldap_dn_parent( return( LDAP_STRDUP( "" ) ); } -char * ldap_dn_rdn( +char * ldap_dn_relative( const char *dn ) { char *s; @@ -287,25 +269,8 @@ char * ldap_dn_rdn( return NULL; } -#ifdef DNS_DN - /* - * no =, assume it is a dns name, like blah@some.domain.name - * if the blah@ part is there, return some.domain.name. if - * it's just some.domain.name, return domain.name. - */ - if ( strchr( rdn, '=' ) == NULL ) { - if ( (s = strchr( rdn, '@' )) == NULL ) { - if ( (s = strchr( rdn, '.' )) == NULL ) { - return( rdn ); - } - } - *s = '\0'; - return( rdn ); - } -#endif - /* - * else assume it is an X.500-style name, which looks like + * assume it is an X.500-style name, which looks like * foo=bar,sha=baz,... */