s3-lsa: Fix static list of luids in our privileges implementation.
[Samba/ekacnet.git] / source4 / libcli / resolve / resolve_lp.c
blob887e0d543e4e7ec0b21e4a89b0d58941ec22976f
1 /*
2 Unix SMB/CIFS implementation.
3 Samba utility functions
4 Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include "includes.h"
21 #include "libcli/resolve/resolve.h"
22 #include "param/param.h"
24 struct resolve_context *lp_resolve_context(struct loadparm_context *lp_ctx)
26 const char **methods = lp_name_resolve_order(lp_ctx);
27 int i;
28 struct resolve_context *ret = resolve_context_init(lp_ctx);
30 if (ret == NULL)
31 return NULL;
33 for (i = 0; methods != NULL && methods[i] != NULL; i++) {
34 if (!strcmp(methods[i], "wins")) {
35 resolve_context_add_wins_method_lp(ret, lp_ctx);
36 } else if (!strcmp(methods[i], "bcast")) {
37 resolve_context_add_bcast_method_lp(ret, lp_ctx);
38 } else if (!strcmp(methods[i], "file")) {
39 resolve_context_add_file_method_lp(ret, lp_ctx);
40 } else if (!strcmp(methods[i], "host")) {
41 resolve_context_add_host_method(ret);
42 } else {
43 DEBUG(0, ("Unknown resolve method '%s'\n", methods[i]));
47 return ret;