summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-01-20 01:24:59 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-01-20 01:24:59 +0000
commit93a8358910d2b8788ffea33c04244ffd5ffecabf (patch)
treeb087c75b8cdf4818a8355e678b1e212cc3f9052d /source3/rpc_parse
parenta6541401b03e0a97dc7e265b223289cad7160b75 (diff)
downloadsamba-93a8358910d2b8788ffea33c04244ffd5ffecabf.tar.gz
samba-93a8358910d2b8788ffea33c04244ffd5ffecabf.tar.bz2
samba-93a8358910d2b8788ffea33c04244ffd5ffecabf.zip
This patch makes the 'winbind use default domain' code interact better with
smbd, and also makes it much cleaner inside winbindd. It is mostly my code, with a few changes and testing performed by Alexander Bokovoy <a.bokovoy@sam-solutions.net>. ab has tested it in security=domain and security=ads, but more testing is always appricatiated. The idea is that we no longer cart around a 'domain\user' string, we keep them seperate until the last moment - when we push that string into a pwent on onto the socket. This removes the need to be constantly parsing that string - the domain prefix is almost always already provided, (only a couple of functions actually changed arguments in all this). Some consequential changes to the RPC client code, to stop it concatonating the two strings (it now passes them both back as params). I havn't changed the cache code, however the usernames will no longer have a double domain prefix in the key string. The actual structures are unchanged - but the meaning of 'username' in the 'rid' will have changed. (The cache is invalidated at startup, so on-disk formats are not an issue here). Andrew Bartlett (This used to be commit e870f0e727952aeb8599cf93ad2650ae56eca033)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_lsa.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/source3/rpc_parse/parse_lsa.c b/source3/rpc_parse/parse_lsa.c
index 12b0ec2e16..04acc75d7e 100644
--- a/source3/rpc_parse/parse_lsa.c
+++ b/source3/rpc_parse/parse_lsa.c
@@ -1045,7 +1045,7 @@ makes a structure.
********************************************************************/
void init_q_lookup_names(TALLOC_CTX *mem_ctx, LSA_Q_LOOKUP_NAMES *q_l,
- POLICY_HND *hnd, int num_names, const char **names)
+ POLICY_HND *hnd, int num_names, const char **dom_names, const char **names)
{
int i;
@@ -1072,10 +1072,20 @@ void init_q_lookup_names(TALLOC_CTX *mem_ctx, LSA_Q_LOOKUP_NAMES *q_l,
for (i = 0; i < num_names; i++) {
const char *name = names[i];
- int len = strlen(name);
+ const char *dom_name = dom_names[i];
+ char *full_name;
+ int len;
+
+ full_name = talloc_asprintf(mem_ctx, "%s\\%s", dom_name, name);
+ if (!full_name) {
+ DEBUG(0, ("init_q_lookup_names(): out of memory doing talloc_asprintf\n"));
+ return;
+ }
+
+ len = strlen(full_name);
init_uni_hdr(&q_l->hdr_name[i], len);
- init_unistr2(&q_l->uni_name[i], name, len);
+ init_unistr2(&q_l->uni_name[i], full_name, len);
}
}