]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
X.500 -> LDAP
authorKurt Zeilenga <kurt@openldap.org>
Sun, 25 Oct 1998 16:48:57 +0000 (16:48 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 25 Oct 1998 16:48:57 +0000 (16:48 +0000)
clients/ud/Version.c
clients/ud/auth.c
clients/ud/find.c
clients/ud/group.c
clients/ud/help.c
clients/ud/main.c
clients/ud/mod.c
clients/ud/util.c

index c4d8e2c2db120223365db09bc572e2f1197cc9a7..ddcc5db7dc0c8449bb14de92952287bf1b88786a 100644 (file)
@@ -10,4 +10,4 @@
  * is provided ``as is'' without express or implied warranty.
  */
 
-char Version[] = "  X.500 UserDirectory %VERSION% (%WHEN%)\n\t%WHOANDWHERE%\n";
+char Version[] = "LDAP UserDirectory %VERSION% (%WHEN%)\n\t%WHOANDWHERE%\n";
index 97be3f545c9a802909484fdd97e31b4843462b8c..65793f1793a4c5d8f665b6b9aee7334014c7bdca 100644 (file)
@@ -157,7 +157,7 @@ int implicit;
 
                if ( hassimple && !kinited ) {
                        printf("  Which password would you like to use?\n");
-                       printf("    1 -> X.500 password\n");
+                       printf("    1 -> LDAP password\n");
 #ifdef UOFM
                        printf("    2 -> UMICH password (aka Uniqname or Kerberos password)\n");
 #else
@@ -223,7 +223,7 @@ int implicit;
        } else {
 #endif
                authmethod = LDAP_AUTH_SIMPLE;
-               sprintf(prompt, "  Enter your X.500 password: ");
+               sprintf(prompt, "  Enter your LDAP password: ");
                do {
                        passwd = mygetpass(prompt);
                } while (passwd != NULL && *passwd == '\0');
index 3551c1af6d7674dcc6153cce5a52b93072903d12..7d4930b5d61f788847763820e5edf2597d4cf650 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
+#include <time.h>
 #ifndef __STDC__
 #include <memory.h>
 #endif
+
 #include <lber.h>
 #include <ldap.h>
+
 #include "ud.h"
 
 extern char *search_base;      /* search base */
@@ -224,7 +227,7 @@ int quiet;
                } else if (matches == 1) {
                        if (ldap_search_s(ld, ldap_get_dn(ld, ldap_first_entry(ld, res)), LDAP_SCOPE_BASE, "objectClass=*", read_attrs, FALSE, &res) != LDAP_SUCCESS) {
                                if (ld->ld_errno == LDAP_UNAVAILABLE)
-                                       printf("  Could not contact the X.500 server to find \"%s\".\n", who);
+                                       printf("  Could not contact the LDAP server to find \"%s\".\n", who);
                                else
                                        ldap_perror(ld, "ldap_search_s");
                                return(NULL);
index 64006170eb356e48dc970f8cd9145162160317c5..5d6ed6d6848b29d35247fcc7e22ed3933e87ad08 100644 (file)
 
 #include <stdio.h>
 #include <string.h>
+#include <time.h>
+
 #include <lber.h>
 #include <ldap.h>
+
 #include <ldapconfig.h>
 #include "ud.h"
 
@@ -175,7 +178,7 @@ char *name;
 #endif
 
        /*
-        *  Now add this to the X.500 Directory.
+        *  Now add this to the LDAP Directory.
         */
        if (ldap_add_s(ld, dn, attrs) != 0) {
                ldap_perror(ld, "  ldap_add_s");
@@ -225,7 +228,7 @@ char *name;
                return;
 
        /*
-        *  Now remove this from the X.500 Directory.
+        *  Now remove this from the LDAP Directory.
         */
        if (ldap_delete_s(ld, dn) != 0) {
                if (ld->ld_errno == LDAP_INSUFFICIENT_ACCESS)
@@ -452,7 +455,7 @@ char *group;
                }
 
                /*
-                *  Add the X.500 style names.
+                *  Add the LDAP style names.
                 */
                if (count_x500 > 0) {
                        mods[0] = &mod;
@@ -562,7 +565,7 @@ char *group;
        vp = Entry.attrs[attr_to_index("member")].values;
        if (vp == NULL) {
                if (verbose)
-                       printf("  \"%s\" has no X.500 members.  There is nothing to purge.\n", group);
+                       printf("  \"%s\" has no LDAP members.  There is nothing to purge.\n", group);
                return;
        }
        for (; *vp != NULL; vp++) {
@@ -805,7 +808,7 @@ int offset;
        }
        if (verbose) {
                printf("\n");
-               format("Values may be specified as a name (which is then looked up in the X.500 Directory) or as a domain-style (i.e., user@domain) e-mail address.  Simply hit the RETURN key at the prompt when finished.\n", 75, 2);
+               format("Values may be specified as a name (which is then looked up in the LDAP Directory) or as a domain-style (i.e., user@domain) e-mail address.  Simply hit the RETURN key at the prompt when finished.\n", 75, 2);
                printf("\n");
        }
 
index 5a1ff231e07f15675510d0bac6a9fcd3a3755590..a3056793865178cd874c6d08ffe984d3dacddcfd 100644 (file)
 #include <stdio.h>
 #include <ctype.h>
 #include <string.h>
+#include <time.h>
+
 #include <lber.h>
 #include <ldap.h>
+
 #include "ud.h"
 
 #ifdef DEBUG
@@ -88,7 +91,7 @@ char *s;
                format("should be specified as a ordinary name (e.g., 'Friends of maX500').", 75, 15);
                printf("\n");
                printf("  [where]      A place in the Directory needs to be specified.  This name\n");
-               format("should be specified as an X.500-style name (e.g., 'ou=people, o=University of Michigan, c=United States of America').  In most cases, it is easier to omit the [where] and allow the program to guide you.", 75, 15);
+               format("should be specified as an LDAP-style name (e.g., 'ou=people, o=University of Michigan, c=United States of America').  In most cases, it is easier to omit the [where] and allow the program to guide you.", 75, 15);
                printf("\n");
                printf("  [who]        A person in the Directory needs to be specified.  This name\n");
                format("can be specified as either a ordinary name (e.g., 'Jane Doe'), or as some other identifying characteristic (e.g., 'uid=babs').", 75, 15);
@@ -111,7 +114,7 @@ char *s;
        }
        else if (!strncasecmp("groupbase", s, len)) {
                printf("  groupbase [where]\n\n");
-               format("The syntax and use of this command is identical to the more commonly used 'cb' command.  This command sets the base which is used to create groups in the X.500 Directory.  Setting the base to a certain value does not necessarily grant the person write-access to that part of the Directory in order to successfully create a group.", 75, 2);
+               format("The syntax and use of this command is identical to the more commonly used 'cb' command.  This command sets the base which is used to create groups in the LDAP Directory.  Setting the base to a certain value does not necessarily grant the person write-access to that part of the Directory in order to successfully create a group.", 75, 2);
        }
        else if (!strncasecmp("cd", s, len) || !strncasecmp("cb", s,len)) {
                printf("  cb [where]\n");
@@ -125,7 +128,7 @@ char *s;
        printf("\n            * cb default\n\n");
        format("sets the search base to its original default value.", 75, 2);
        printf("\n            * cb o=Merit Computer Network, c=US\n\n");
-       format("sets the search base to organization given, the Merit Computer Network in this case.  This comamnd checks the validity of the specified search base, and rejects it if it is not a valid Distinguished Name (DN).  A DN uniquely identifies a portion of the global X.500 namespace.", 75, 2);
+       format("sets the search base to organization given, the Merit Computer Network in this case.  This comamnd checks the validity of the specified search base, and rejects it if it is not a valid Distinguished Name (DN).  A DN uniquely identifies a portion of the global LDAP namespace.", 75, 2);
        }
        else if (!strncasecmp("quit", s, len) || !strncasecmp("stop",s, len)) {
                printf("  quit\n");
@@ -145,7 +148,7 @@ char *s;
        else if (!strncasecmp("modify", s, len) || !strncasecmp("change", s, len)) {
                printf("  modify [entry]\n");
                printf("  change [entry]\n\n");
-               format("Changes information associated with an entry in the X.500 Directory.  'change' is an alias for 'modify'.", 75, 2);
+               format("Changes information associated with an entry in the LDAP Directory.  'change' is an alias for 'modify'.", 75, 2);
        }
        else if (!strncasecmp("verbose", s, len)) {
                printf("  verbose\n\n");
@@ -182,7 +185,7 @@ char *s;
        }
        else if (!strncasecmp("tidy", s, len)) {
                printf("  tidy\n\n");
-               format("Unsubscribes you from non-existent groups.  Useful when you cannot resign from a group because, while your X.500 entry still contains a pointer to it, someone has removed a group of which you were a subscriber.", 75, 2);
+               format("Unsubscribes you from non-existent groups.  Useful when you cannot resign from a group because, while your LDAP entry still contains a pointer to it, someone has removed a group of which you were a subscriber.", 75, 2);
        }
        else if (*s == '?') {
                format("Prints out a brief description of each command.  Same as typing 'help help'.", 75, 2);
index cb2030c2833505a62e163df2509bae5d9f2fa734..5f2b848e65933f450959282a1e5f1dba9c688aa2 100644 (file)
@@ -33,7 +33,8 @@
 #include <termios.h>
 #endif /* defined( NeXT ) || defined( ultrix ) etc. */
 #endif /* !DOS */
-#if defined( aix ) || defined( __NetBSD__ )
+#if defined( aix ) || defined( __NetBSD__ ) \
+       || defined( __FreeBSD__ ) || defined( linux )
 #include <sys/ioctl.h>
 #endif /* aix || __NetBSD__ */
 #include <ctype.h>
@@ -68,8 +69,8 @@ static int dereference = TRUE;
 char *default_bind_object = UD_BINDDN;
 
 char *bound_dn;                        /* bound user's Distinguished Name */
-char *group_base;              /* place in X.500 tree where groups are */
-char *search_base;             /* place in X.500 tree where searches start */
+char *group_base;              /* place in LDAP tree where groups are */
+char *search_base;             /* place in LDAP tree where searches start */
 
 static jmp_buf env;            /* spot to jump to on an interrupt */
 
@@ -374,7 +375,7 @@ char **base, *s;
        }
 
        /*
-        *  User wants to ascend one level in the X.500 tree.
+        *  User wants to ascend one level in the LDAP tree.
         *  Easy:  Just strip off the first element of the
         *  current search base, unless it's the root, in
         *  which case we just do nothing.
@@ -627,13 +628,13 @@ initialize_client()
         *  because we want to be sure to use TCP, not UDP.
         */
        if ((ld = ldap_open(server, ldap_port)) == NULL) {
-               fprintf(stderr, "  The X.500 Directory is temporarily unavailable.  Please try again later.\n");
+               fprintf(stderr, "  The LDAP Directory is temporarily unavailable.  Please try again later.\n");
                exit(0);
                /* NOTREACHED */
        }
-       if (ldap_bind_s(ld, (char *) default_bind_object, (char *) UD_PASSWD,
+       if (ldap_bind_s(ld, (char *) default_bind_object, (char *) UD_BIND_CRED,
            LDAP_AUTH_SIMPLE) != LDAP_SUCCESS) {
-               fprintf(stderr, "  The X.500 Directory is temporarily unavailable.  Please try again later.\n");
+               fprintf(stderr, "  The LDAP Directory is temporarily unavailable.  Please try again later.\n");
                if (ld->ld_errno != LDAP_UNAVAILABLE)
                        ldap_perror(ld, "  ldap_bind_s");
                exit(0);
@@ -722,3 +723,22 @@ SIG_FN chwinsz()
        (void) signal(SIGWINCH, chwinsz);
 }
 #endif
+
+#if defined(NO_CACHE)
+
+void ldap_uncache_entry( LDAP *ld, char *dn )
+{
+
+}
+
+int ldap_enable_cache( LDAP *ld, long timeout, long maxmem )
+{
+  return 0;
+}
+
+void ldap_flush_cache( LDAP *ld )
+{
+
+}
+
+#endif /* NO_CACHE */
index ef7099e9489a9161605e933938297c956e46e4ea..45492d59662f1589c0b756c9c848c45419ed4e01 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
-#include <lber.h>
-#include <ldap.h>
+#include <time.h>
 #ifndef __STDC__
 #include <memory.h>
 #endif
 #include <sys/types.h>
+
+#include <lber.h>
+#include <ldap.h>
 #include "ud.h"
 
 extern struct entry Entry; 
@@ -109,7 +111,7 @@ char *who;
        if (verbose && !printed_warning && (ld->ld_errno == LDAP_NO_SUCH_ATTRIBUTE)) {
                printed_warning = 1;
                printf("\n  WARNING!\n");
-               printf("  You are about to make a modification to an X.500 entry\n");
+               printf("  You are about to make a modification to an LDAP entry\n");
                printf("  that has its \"automatic updates\" field set to ON.\n");
                printf("  This means that the entry will be automatically updated\n");
                printf("  each month from official University sources like the\n");
@@ -481,7 +483,7 @@ mail_is_good:
                        if (lmp == (LDAPMessage *) NULL) {
                                printf("  Could not find \"%s\" in the Directory\n", line);
                                if (verbose) 
-                                       format("Owners of groups must be valid entries in the X.500 Directory.  The name you have typed above could not be found in the X.500 Directory.", 72, 2);
+                                       format("Owners of groups must be valid entries in the LDAP Directory.  The name you have typed above could not be found in the LDAP Directory.", 72, 2);
                                return(NULL);
                        }
                        elmp = ldap_first_entry(ld, lmp);
@@ -620,9 +622,9 @@ char *who;
        if (verbose) {
                printf("\n  By default, updates that are received from the Personnel\n");
                printf("  Office and the Office of the Registrar are applied to all\n");
-               printf("  entries in the X.500 database each month.  Sometimes this\n");
+               printf("  entries in the LDAP database each month.  Sometimes this\n");
                printf("  feature is undesirable.  For example, if you maintain your\n");
-               printf("  entry in the X.500 database manually, you may not want to\n");
+               printf("  entry in the LDAP database manually, you may not want to\n");
                printf("  have these updates applied to your entry, possibly overwriting\n");
                printf("  correct information with out-dated information.\n\n");
        }
index 2edb5aa265903c9be92d107413b5e0ee183610fd..0dd3c53c35f138d92fdcb9dcac292fa7163938ba 100644 (file)
 #include <stdlib.h>
 #endif
 #include <ctype.h>
+#include <time.h>
 #include <errno.h>
+
 #include <lber.h>
 #include <ldap.h>
+
 #include <ldapconfig.h>
+
 #if !defined(DOS) && !defined( VMS)
 #include <sys/types.h>
 #endif
@@ -34,6 +38,7 @@
 #else /* USE_TERMIOS */
 #include <sgtty.h>
 #endif /* USE_TERMIOS */
+
 #include "ud.h"
 
 #if defined(VMS)
@@ -80,7 +85,7 @@ char *prompt;
 #endif
        /*
         *  Stolen from the getpass() routine.  Can't use the plain
-        *  getpass() for two reasons.  One is that X.500 passwords
+        *  getpass() for two reasons.  One is that LDAP passwords
         *  can be really, really long - much longer than 8 chars.
         *  The second is that we like to make this client available
         *  out of inetd via a Merit asynch port, and we need to be
@@ -226,8 +231,6 @@ FILE *where;
 fatal(s)
 char *s;
 {
-       void exit();
-
        if (errno != 0)
                perror(s);
 #ifdef KERBEROS
@@ -477,7 +480,7 @@ char *cp;
        return(tmp);
 }
 
-char * code_to_str(i)
+char * code_to_str(int i)
 {
        switch(i) {
        case LDAP_MOD_ADD : return("ADD");