/* Client Server Praktikum Universität Tübingen * * Aufgabe n, * Thema: LDAP * Thomas Klinkert * */ #define HOST "localhost" #define PORT 1099 #define BASE "dc=uni-tuebingen,dc=de" #define PASSWD "secret" #define ROOTDN "cn=admin,dc=uni-tuebingen,dc=de" #include #include #include main() { LDAP *ld; LDAPMessage *res, *e; int i; char *a, *dn; void *ptr; char **vals; /* open a connection */ if ( (ld = ldap_open(HOST,PORT)) == 0) exit(1); printf("connecting to ldap server ...\n"); /* authentification */ /* Bind-Operation in Openldap v3 in der Regel nicht nötig*/ /*if ( ldap_simple_bind_s(ld, ROOTDN, PASSWD) != LDAP_SUCCESS) exit(1); printf("bind ...\n"); */ /* do something */ ldap_msgfree( res); ldap_unbind(ld); }