static int searchscope = LDAP_SCOPE_SUBTREE;
static int persistent = 0;
static int noreferrals = 0;
-static int debug = 0;
+static int show_debug_messages = 0;
static int port = LDAP_PORT;
static int strip_nt_domain = 0;
static int aliasderef = LDAP_DEREF_NEVER;
snprintf(filter, sizeof(filter), usersearchfilter, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login, escaped_login);
retrysrch:
- if (debug)
+ if (show_debug_messages)
fprintf(stderr, "user filter '%s', searchbase '%s'\n", filter, searchbase);
rc = ldap_search_s(ld, searchbase, searchscope, filter, NULL, 0, &res);
snprintf(searchbase, 8192, "%s=%s, %s", userdnattr, login, userbasedn);
retrydnattr:
- if (debug)
+ if (show_debug_messages)
fprintf(stderr, "searchbase '%s'\n", searchbase);
rc = ldap_search_s(ld, searchbase, searchscope, NULL, NULL, 0, &res);
}
return NULL;
}
if (!values) {
- if (debug)
+ if (show_debug_messages)
printf("No attribute value found\n");
ldap_msgfree(res);
return NULL;
}
value++;
}
- if (debug)
+ if (show_debug_messages)
printf("password: %s\n", password);
if (password)
password = xstrdup(password);
ld = NULL;
}
}
- if (debug)
+ if (show_debug_messages)
fprintf(stderr, "Connected OK\n");
}
}
break;
#endif
case 'd':
- debug = 1;
+ show_debug_messages = 1;
break;
case 'E':
strip_nt_domain = 1;