]> git.sur5r.net Git - openldap/blobdiff - clients/ud/util.c
Initial implementation of Kerberos password verification for
[openldap] / clients / ud / util.c
index 70a6c54ee91996a1a8d229693064ef11f3592b48..575df353140f97dcc9ae5a8b1713673eebdd88d3 100644 (file)
@@ -1,3 +1,8 @@
+/* $OpenLDAP$ */
+/*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
 /*
  * Copyright (c) 1992, 1993  Regents of the University of Michigan.
  * All rights reserved.
@@ -26,8 +31,8 @@
 
 #include <lber.h>
 #include <ldap.h>
-#include <ldap_defaults.h>
 
+#include "ldap_defaults.h"
 #include "ud.h"
 
 void
@@ -99,10 +104,10 @@ fatal( char *s )
 {
        if (errno != 0)
                perror(s);
-#ifdef HAVE_KERBEROS
+#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
        destroy_tickets();
 #endif
-       exit(-1);
+       exit( EXIT_FAILURE );
 }
 
 int
@@ -404,15 +409,19 @@ isadn( char *s )
 char *
 my_ldap_dn2ufn( char *s )
 {
+#ifdef UD_BASE
        register char **cpp;
        static char short_DN[BUFSIZ];
 
-       if (strstr(s, NULL) == NULL)
+       if (strstr(s, UD_BASE) == NULL)
                return(ldap_dn2ufn(s));
        cpp = ldap_explode_dn(s, TRUE);
        sprintf(short_DN, "%s, %s", *cpp, *(cpp + 1));
        ldap_value_free(cpp);
        return(short_DN);
+#else
+       return(ldap_dn2ufn(s));
+#endif
 }
 
 /* return TRUE if this attribute should be printed as a URL */
@@ -451,7 +460,7 @@ Malloc( unsigned int size )
        void_ptr = (void *) malloc(size);
        if (void_ptr == NULL) {
                perror("malloc");
-               exit(-1);
+               exit( EXIT_FAILURE );
                /*NOTREACHED*/
        }
        return(void_ptr);