Whamcloud - gitweb
- added, may prove useful as the first 20 lines of code.
authorbraam <braam>
Mon, 15 Apr 2002 17:59:46 +0000 (17:59 +0000)
committerbraam <braam>
Mon, 15 Apr 2002 17:59:46 +0000 (17:59 +0000)
lustre/tests/ldaptest.c [new file with mode: 0644]

diff --git a/lustre/tests/ldaptest.c b/lustre/tests/ldaptest.c
new file mode 100644 (file)
index 0000000..c1a7499
--- /dev/null
@@ -0,0 +1,27 @@
+#include <ldap.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+
+int main(int argc, char **argv)
+{
+        LDAP *ld;
+        int err;
+
+        ld = ldap_init("localhost", 389); 
+        if (!ld) {
+                fprintf(stderr, "ldap_init: %s\n", strerror(errno));
+                exit(1);
+        }
+        
+        err = ldap_bind_s(ld, "cn=Manager,dc=lustre,dc=cfs", "secret", 
+                        LDAP_AUTH_SIMPLE);
+        if (err) { 
+                fprintf(stderr, "ldap_bind: %s\n", ldap_err2string(err));
+                exit(1);
+        }
+
+
+        
+
+}