summaryrefslogtreecommitdiff
path: root/source3/rpcclient/cmd_lsarpc.c
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/rpcclient/cmd_lsarpc.c
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/rpcclient/cmd_lsarpc.c')
-rw-r--r--source3/rpcclient/cmd_lsarpc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c
index 528987d3e2..f6d0569de9 100644
--- a/source3/rpcclient/cmd_lsarpc.c
+++ b/source3/rpcclient/cmd_lsarpc.c
@@ -80,6 +80,7 @@ static NTSTATUS cmd_lsa_lookup_names(struct cli_state *cli,
DOM_SID *sids;
uint32 *types;
int num_names, i;
+ fstring name, domain;
if (argc == 1) {
printf("Usage: %s [name1 [name2 [...]]]\n", argv[0]);
@@ -95,8 +96,10 @@ static NTSTATUS cmd_lsa_lookup_names(struct cli_state *cli,
/* Lookup the names */
+ split_domain_name(argv[1], domain, name);
+
result = cli_lsa_lookup_names(cli, mem_ctx, &pol, argc - 1,
- (const char **)&argv[1], &sids,
+ (const char**)&domain, (const char**)&name, &sids,
&types, &num_names);
if (!NT_STATUS_IS_OK(result))
@@ -124,6 +127,7 @@ static NTSTATUS cmd_lsa_lookup_sids(struct cli_state *cli, TALLOC_CTX *mem_ctx,
POLICY_HND pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
DOM_SID *sids;
+ char **domains;
char **names;
uint32 *types;
int num_names, i;
@@ -155,7 +159,7 @@ static NTSTATUS cmd_lsa_lookup_sids(struct cli_state *cli, TALLOC_CTX *mem_ctx,
/* Lookup the SIDs */
result = cli_lsa_lookup_sids(cli, mem_ctx, &pol, argc - 1, sids,
- &names, &types, &num_names);
+ &domains, &names, &types, &num_names);
if (!NT_STATUS_IS_OK(result))
goto done;
@@ -166,8 +170,9 @@ static NTSTATUS cmd_lsa_lookup_sids(struct cli_state *cli, TALLOC_CTX *mem_ctx,
fstring sid_str;
sid_to_string(sid_str, &sids[i]);
- printf("%s %s (%d)\n", sid_str, names[i] ? names[i] :
- "*unknown*", types[i]);
+ printf("%s [%s]\\[%s] (%d)\n", sid_str,
+ domains[i] ? domains[i] : "*unknown*",
+ names[i] ? names[i] : "*unknown*", types[i]);
}
done: