Lines Matching defs:ctx
190 struct auth_ctx ctx;
195 memset(&ctx, 0, sizeof(struct auth_ctx));
196 TAILQ_INIT(&(ctx.s));
202 ctx.user = user;
204 if (!parse_conf(&ctx, cfile != NULL ? cfile : "/etc/login_ldap.conf"))
208 if (!conn(&ctx)) {
213 if (ctx.basedn == NULL) {
214 if (!bind_password(&ctx, ctx.binddn, pass))
216 ctx.userdn = ctx.binddn;
218 if (!bind_password(&ctx, ctx.binddn, ctx.bindpw))
223 ctx.userdn = search(&ctx, ctx.basedn, ctx.filter, ctx.scope);
224 if (ctx.userdn == NULL) {
230 dlog(1, "userdn %s", ctx.userdn);
232 if (ctx.gbasedn != NULL && ctx.gfilter != NULL) {
233 tmp = ctx.gfilter;
234 if ((ctx.gfilter = parse_filter(&ctx, ctx.gfilter)) == NULL)
237 tmp = ctx.gbasedn;
238 if ((ctx.gbasedn = parse_filter(&ctx, ctx.gbasedn)) == NULL)
242 if (search(&ctx, ctx.gbasedn, ctx.gfilter, ctx.gscope) == NULL) {
244 "%s", ctx.gfilter);
251 if (ctx.basedn != NULL) {
252 if (!bind_password(&ctx, ctx.userdn, pass)) {
253 dlog(0, "user bind failed, dn: %s", ctx.userdn);