Browse Source

* drop 'referrals' keyword : not implemented yet

master
Alex 'AdUser' Z 9 years ago
parent
commit
c68ed8bceb
  1. 3
      src/config.c
  2. 1
      src/config.h
  3. 1
      tests/parse_config.c
  4. 2
      tests/test.conf

3
src/config.c

@ -72,9 +72,6 @@ int parse_config(oal_config_t * const config, const char *file) {
if (strncmp(key, "bindtimeout", 11) == 0) { if (strncmp(key, "bindtimeout", 11) == 0) {
config->bindtimeout = atoi(value); config->bindtimeout = atoi(value);
} else } else
if (strncmp(key, "referrals", 9) == 0) {
config->referrals = atoi(value);
} else
if (strncmp(key, "basedn", 6) == 0) { if (strncmp(key, "basedn", 6) == 0) {
config->basedn = strndup(value, valsize); config->basedn = strndup(value, valsize);
} else } else

1
src/config.h

@ -6,7 +6,6 @@ typedef struct {
char *binddn; /** bind as this user before search for user */ char *binddn; /** bind as this user before search for user */
char *bindpass; /** bind with this password */ char *bindpass; /** bind with this password */
size_t bindtimeout; /** bind timeout */ size_t bindtimeout; /** bind timeout */
short referrals; /** if > 0 - follow referals */
char *basedn; /** where to search for users */ char *basedn; /** where to search for users */
char *userfilter; /** ldap filter for user entry */ char *userfilter; /** ldap filter for user entry */
char error[1024]; /** parser error */ char error[1024]; /** parser error */

1
tests/parse_config.c

@ -16,7 +16,6 @@ int main(void) {
} }
assert(config.bindtimeout == 5); assert(config.bindtimeout == 5);
assert(config.referrals == 2);
assert(strcmp(config.bindpass, "strong-password") == 0); assert(strcmp(config.bindpass, "strong-password") == 0);
assert(strcmp(config.bindurls, "ldap://127.0.0.1 ldaps://172.16.17.1") == 0); assert(strcmp(config.bindurls, "ldap://127.0.0.1 ldaps://172.16.17.1") == 0);
assert(strcmp(config.binddn, "cn=admin,dc=example,dc=com") == 0); assert(strcmp(config.binddn, "cn=admin,dc=example,dc=com") == 0);

2
tests/test.conf

@ -5,7 +5,5 @@ bindpass strong-password
bindtimeout 5 bindtimeout 5
# another comment and empty string below # another comment and empty string below
referrals 2
basedn ou=users,dc=example,dc=com basedn ou=users,dc=example,dc=com
userfilter (objectClass=inetOrgPerson) userfilter (objectClass=inetOrgPerson)

Loading…
Cancel
Save