From 7aebbb90c8e09febd345de10c0b438e98f30468b Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 2 Dec 1999 16:52:38 +0000 Subject: need a domain resolving function, but get_trusted_serverlist() will do. this is horrible. (This used to be commit 9df973fe711f322075d86d6792d6c0b8539c1d00) --- source3/lib/util.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/util.c b/source3/lib/util.c index 9bcbe1a9c7..b0d6e82970 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -3228,3 +3228,37 @@ BOOL become_user_permanently(uid_t uid, gid_t gid) return(True); } +char *get_trusted_serverlist(const char* domain) +{ + pstring tmp; + static char *server_list = NULL; + static pstring srv_list; + char *trusted_list = lp_trusted_domains(); + + if (strequal(lp_workgroup(), domain)) + { + DEBUG(10,("local domain server list: %s\n", server_list)); + pstrcpy(srv_list, lp_passwordserver()); + return srv_list; + } + + if (!next_token(&trusted_list, tmp, NULL, sizeof(tmp))) + { + return NULL; + } + + do + { + fstring trust_dom; + split_at_first_component(tmp, trust_dom, '=', srv_list); + + if (strequal(domain, trust_dom)) + { + return srv_list; + DEBUG(10,("trusted: %s\n", server_list)); + } + + } while (next_token(NULL, tmp, NULL, sizeof(tmp))); + + return NULL; +} -- cgit