diff options
author | Matthew Chapman <matty@samba.org> | 2000-05-29 01:23:48 +0000 |
---|---|---|
committer | Matthew Chapman <matty@samba.org> | 2000-05-29 01:23:48 +0000 |
commit | 7710b4f48d3e8532df5e37f99a779758f750efdb (patch) | |
tree | f503157e185ac8a7df69205661fcf663959e8914 /source/rpc_client/cli_lsarpc.c | |
parent | 2170d72d508ab8fb63a1da3024395f8fd6011cfa (diff) | |
download | samba-7710b4f48d3e8532df5e37f99a779758f750efdb.tar.gz samba-7710b4f48d3e8532df5e37f99a779758f750efdb.tar.xz samba-7710b4f48d3e8532df5e37f99a779758f750efdb.zip |
Fixed LsaQueryInformationPolicy level 3 to return primary domain info.
Domain SID is saved in secrets.tdb upon joining domain.
Added "Authenticated Users" and "SYSTEM" well-known SIDs (under
NT Authority).
Diffstat (limited to 'source/rpc_client/cli_lsarpc.c')
-rw-r--r-- | source/rpc_client/cli_lsarpc.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source/rpc_client/cli_lsarpc.c b/source/rpc_client/cli_lsarpc.c index 34201ebc16f..8362c1d1727 100644 --- a/source/rpc_client/cli_lsarpc.c +++ b/source/rpc_client/cli_lsarpc.c @@ -379,3 +379,26 @@ BOOL do_lsa_close(struct cli_state *cli, POLICY_HND *hnd) return True; } + +/**************************************************************************** +obtain a server's SAM SID and save it in the secrets database +****************************************************************************/ + +BOOL cli_lsa_get_domain_sid(struct cli_state *cli, char *server) +{ + fstring domain, key; + POLICY_HND pol; + DOM_SID sid; + BOOL res, res2, res3; + + res = cli_nt_session_open(cli, PIPE_LSARPC); + res2 = res ? do_lsa_open_policy(cli, server, &pol, 0) : False; + res3 = res2 ? do_lsa_query_info_pol(cli, &pol, 5, domain, &sid) : False; + + res3 = res3 ? secrets_store_domain_sid(domain, &sid) : False; + + res2 = res2 ? do_lsa_close(cli, &pol) : False; + cli_nt_session_close(cli); + + return res3; +} |