3 NTSTATUS torture_ldap_bind(struct ldap_connection *conn, const char *userdn, const char *password)
5 NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
9 printf("We need a valid ldap_connection structure and be connected\n");
13 result = ldap_bind_simple(conn, userdn, password);
14 if (result != LDAP_SUCCESS) {
15 printf("Failed to bind with provided credentials\n");
16 /* FIXME: what abut actually implementing an ldap_connection_free() function ?
24 NTSTATUS torture_ldap_bind_sasl(struct ldap_connection *conn, const char *username, const char *domain, const char *password)
26 NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
30 printf("We need a valid ldap_connection structure and be connected\n");
34 result = ldap_bind_sasl(conn, username, domain, password);
35 if (result != LDAP_SUCCESS) {
36 printf("Failed to bind with provided credentialsi and SASL mechanism\n");
37 /* FIXME: what abut actually implementing an ldap_connection_free() function ?
45 /* open a ldap connection to a server */
46 NTSTATUS torture_ldap_connection(struct ldap_connection **conn,
47 const char *url, const char *userdn, const char *password)
49 NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
53 printf("You must specify a url string\n");
54 return NT_STATUS_INVALID_PARAMETER;
57 *conn = new_ldap_connection();
59 printf("Failed to initialize ldap_connection structure\n");
63 ret = ldap_setup_connection(*conn, url, userdn, password);
65 printf("Failed to connect with url [%s]\n", url);
66 /* FIXME: what abut actually implementing an ldap_connection_free() function ?
74 /* close an ldap connection to a server */
75 NTSTATUS torture_ldap_close(struct ldap_connection *conn)
77 /* FIXME: what about actually implementing ldap_close() ?