600 cxstring type = serverconfig_object_directive_value(obj, cx_str("Type")); |
600 cxstring type = serverconfig_object_directive_value(obj, cx_str("Type")); |
601 |
601 |
602 AuthDB *authdb = NULL; |
602 AuthDB *authdb = NULL; |
603 |
603 |
604 if(!cx_strcmp(type, cx_str("ldap"))) { |
604 if(!cx_strcmp(type, cx_str("ldap"))) { |
605 LDAPConfig conf; |
605 authdb = create_ldap_authdb(cfg, name.ptr, obj); |
606 |
|
607 cxstring host = serverconfig_object_directive_value(obj, cx_str("Host")); |
|
608 cxstring port = serverconfig_object_directive_value( obj, cx_str("Port")); |
|
609 cxstring basedn = serverconfig_object_directive_value(obj, cx_str("BaseDN")); |
|
610 cxstring binddn = serverconfig_object_directive_value(obj, cx_str("BindDN")); |
|
611 cxstring basepw = serverconfig_object_directive_value(obj, cx_str("BindPW")); |
|
612 |
|
613 conf.hostname = cx_strdup_a(cfg->a, host).ptr; |
|
614 conf.port = atoi(port.ptr); |
|
615 conf.basedn = cx_strdup_a(cfg->a, basedn).ptr; |
|
616 conf.binddn = cx_strdup_a(cfg->a, binddn).ptr; |
|
617 conf.bindpw = cx_strdup_a(cfg->a, basepw).ptr; |
|
618 |
|
619 authdb = create_ldap_authdb(cfg, name.ptr, &conf); |
|
620 } else if(!cx_strcmp(type, cx_str("keyfile"))) { |
606 } else if(!cx_strcmp(type, cx_str("keyfile"))) { |
621 // we only need the file parameter |
607 // we only need the file parameter |
622 cxstring file = serverconfig_object_directive_value(obj, cx_str("File")); |
608 cxstring file = serverconfig_object_directive_value(obj, cx_str("File")); |
623 if(file.length == 0) { |
609 if(file.length == 0) { |
624 log_ereport( |
610 log_ereport( |