~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/auth/auth-settings.c

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2005-2012 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2005-2013 Dovecot authors, see the included COPYING file */
2
2
 
3
3
#include "lib.h"
4
4
#include "array.h"
17
17
/* <settings checks> */
18
18
static struct file_listener_settings auth_unix_listeners_array[] = {
19
19
        { "login/login", 0666, "", "" },
 
20
        { "token-login/tokenlogin", 0666, "", "" },
20
21
        { "auth-login", 0600, "$default_internal_user", "" },
21
22
        { "auth-client", 0600, "", "" },
22
23
        { "auth-userdb", 0666, "$default_internal_user", "" },
27
28
        &auth_unix_listeners_array[1],
28
29
        &auth_unix_listeners_array[2],
29
30
        &auth_unix_listeners_array[3],
30
 
        &auth_unix_listeners_array[4]
 
31
        &auth_unix_listeners_array[4],
 
32
        &auth_unix_listeners_array[5]
31
33
};
32
34
static buffer_t auth_unix_listeners_buf = {
33
35
        auth_unix_listeners, sizeof(auth_unix_listeners), { 0, }
109
111
        DEF(SET_STR, args),
110
112
        DEF(SET_STR, default_fields),
111
113
        DEF(SET_STR, override_fields),
 
114
        DEF(SET_ENUM, skip),
 
115
        DEF(SET_ENUM, result_success),
 
116
        DEF(SET_ENUM, result_failure),
 
117
        DEF(SET_ENUM, result_internalfail),
112
118
        DEF(SET_BOOL, deny),
113
119
        DEF(SET_BOOL, pass),
114
120
        DEF(SET_BOOL, master),
121
127
        .args = "",
122
128
        .default_fields = "",
123
129
        .override_fields = "",
 
130
        .skip = "never:authenticated:unauthenticated",
 
131
        .result_success = "return-ok:return:return-fail:continue:continue-ok:continue-fail",
 
132
        .result_failure = "continue:return:return-ok:return-fail:continue-ok:continue-fail",
 
133
        .result_internalfail = "continue:return:return-ok:return-fail:continue-ok:continue-fail",
124
134
        .deny = FALSE,
125
135
        .pass = FALSE,
126
136
        .master = FALSE
200
210
        DEF(SET_STR, winbind_helper_path),
201
211
        DEF(SET_STR, proxy_self),
202
212
        DEF(SET_TIME, failure_delay),
203
 
        DEF(SET_UINT, first_valid_uid),
204
 
        DEF(SET_UINT, last_valid_uid),
205
213
 
206
214
        DEF(SET_BOOL, verbose),
207
215
        DEF(SET_BOOL, debug),
218
226
 
219
227
        DEF_NOPREFIX(SET_STR, base_dir),
220
228
        DEF_NOPREFIX(SET_BOOL, verbose_proctitle),
 
229
        DEF_NOPREFIX(SET_UINT, first_valid_uid),
 
230
        DEF_NOPREFIX(SET_UINT, last_valid_uid),
221
231
 
222
232
        SETTING_DEFINE_LIST_END
223
233
};
239
249
        .winbind_helper_path = "/usr/bin/ntlm_auth",
240
250
        .proxy_self = "",
241
251
        .failure_delay = 2,
242
 
        .first_valid_uid = 500,
243
 
        .last_valid_uid = 0,
244
252
 
245
253
        .verbose = FALSE,
246
254
        .debug = FALSE,
256
264
        .userdbs = ARRAY_INIT,
257
265
 
258
266
        .base_dir = PKG_RUNDIR,
259
 
        .verbose_proctitle = FALSE
 
267
        .verbose_proctitle = FALSE,
 
268
        .first_valid_uid = 500,
 
269
        .last_valid_uid = 0,
260
270
};
261
271
 
262
272
const struct setting_parser_info auth_setting_parser_info = {
278
288
                           const char **error_r)
279
289
{
280
290
        const char *const *tmp;
281
 
        ARRAY_DEFINE(ips_array, struct ip_addr);
 
291
        ARRAY(struct ip_addr) ips_array;
282
292
        struct ip_addr *ips;
283
293
        unsigned int ips_count;
284
294
        int ret;
299
309
                }
300
310
                array_append(&ips_array, ips, ips_count);
301
311
        }
302
 
        (void)array_append_space(&ips_array);
 
312
        array_append_zero(&ips_array);
303
313
        set->proxy_self_ips = array_idx(&ips_array, 0);
304
314
        return TRUE;
305
315
}
361
371
                *error_r = "passdb is missing driver";
362
372
                return FALSE;
363
373
        }
 
374
        if (set->pass && strcmp(set->result_success, "return-ok") != 0) {
 
375
                *error_r = "Obsolete pass=yes setting mixed with non-default result_success";
 
376
                return FALSE;
 
377
        }
364
378
        return TRUE;
365
379
}
366
380
 
390
404
        };
391
405
        struct master_service_settings_input input;
392
406
        struct setting_parser_context *set_parser;
393
 
        struct auth_settings *set;
394
407
        const char *error;
 
408
        void **sets;
395
409
 
396
410
        memset(&input, 0, sizeof(input));
397
411
        input.roots = set_roots;
406
420
        if (!settings_parser_check(set_parser, pool, &error))
407
421
                i_unreached();
408
422
 
409
 
        set = settings_parser_get_list(set_parser)[1];
 
423
        sets = master_service_settings_parser_get_others(master_service,
 
424
                                                         set_parser);
410
425
        settings_parser_deinit(&set_parser);
411
 
        return set;
 
426
        return sets[0];
412
427
}