]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/dn.c
Don't copy and leak user; it's an env var so just use it directly.
[openldap] / libraries / libldap / dn.c
index b658bed7698baf661299fc29de85f4b08d477244..d60edd0cec6e60234a63e36e5f65289d14802a83 100644 (file)
@@ -9,7 +9,6 @@
 
 #include <stdio.h>
 
-#include <ac/ctype.h>
 #include <ac/socket.h>
 #include <ac/string.h>
 #include <ac/time.h>
@@ -217,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,...
         */
 
@@ -263,7 +244,7 @@ ldap_dn_parent(
        return( LDAP_STRDUP( "" ) );
 }
 
-char * ldap_dn_rdn
+char * ldap_dn_relative
     const char *dn )
 {
        char    *s;
@@ -288,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,...
         */