]> git.sur5r.net Git - openldap/blobdiff - clients/ud/main.c
modify ldap_dn2ufn() to return completely typeless UFNs
[openldap] / clients / ud / main.c
index 537280afe2772b5d84e9d054fcda8517237d6905..4e2dac8adbbefb58fa8741e24e6b335256bb8333 100644 (file)
@@ -1,6 +1,6 @@
 /* $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
  */
 /*
@@ -44,7 +44,6 @@
 #include <sys/file.h>
 #endif
 
-#include <lber.h>
 #include <ldap.h>
 
 #include "ldap_defaults.h"
@@ -332,7 +331,7 @@ change_base( int type, char **base, char *s )
 {
        register char *cp;                      /* utility pointers */
        char **rdns;                            /* for parsing */
-       char *output_string;                    /* for nice output */
+       char *output_string = NULL;             /* for nice output */
        int num_picked;                         /* # of selected base */
        int j;                                  /* used with num_picked */
        int i = 1;                              /* index into choices array */
@@ -435,7 +434,7 @@ change_base( int type, char **base, char *s )
                 *  the user if they want to see more.  They can also just
                 *  type a number at that point too.
                 */
-               if (ldap_search_s(ld, *base, LDAP_SCOPE_ONELEVEL, "(|(objectClass=quipuNonLeafObject)(objectClass=externalNonLeafObject))", attrs, FALSE, &mp) != LDAP_SUCCESS) {
+               if (ldap_search_s(ld, *base, LDAP_SCOPE_ONELEVEL, NULL, attrs, FALSE, &mp) != LDAP_SUCCESS) {
                        int ld_errno = 0;
                        ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ld_errno);
                        if ((ld_errno == LDAP_TIMELIMIT_EXCEEDED) ||
@@ -660,12 +659,7 @@ initialize_client( void )
        }
        if (ldap_bind_s(ld, (char *) default_bind_object, NULL,
            LDAP_AUTH_SIMPLE) != LDAP_SUCCESS) {
-               int ld_errno = 0;
-               ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ld_errno);
-
-               fprintf(stderr, "  The LDAP Directory is temporarily unavailable.  Please try again later.\n");
-               if (ld_errno != LDAP_UNAVAILABLE)
-                       ldap_perror(ld, "  ldap_bind_s");
+               ldap_perror(ld, "  ldap_bind_s");
                exit( EXIT_FAILURE );
                /* NOTREACHED */
        }
@@ -733,7 +727,7 @@ attn( int sig )
        fflush(stdout);
        printf("\n\n  INTERRUPTED!\n");
 
-       (void) SIGNAL (SIGINT, attn);
+       (void) SIGNAL_REINSTALL (SIGINT, attn);
 
        longjmp(env, 1);
 }
@@ -752,6 +746,6 @@ chwinsz( int sig )
                        col_size = win.ws_col;
        }
 
-       (void) SIGNAL (SIGWINCH, chwinsz);
+       (void) SIGNAL_REINSTALL (SIGWINCH, chwinsz);
 }
 #endif