1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-23 09:57:40 +03:00

r23627: Allow to pass down the lookup-level to rpccli_lsa_lookup_names().

Guenther
This commit is contained in:
Günther Deschner 2007-06-27 11:42:17 +00:00 committed by Gerald (Jerry) Carter
parent 555ae4a19b
commit e9a7512a9f
13 changed files with 24 additions and 22 deletions

View File

@ -337,7 +337,7 @@ int cac_LsaGetSidsFromNames( CacServerHandle * hnd, TALLOC_CTX * mem_ctx,
rpccli_lsa_lookup_names( pipe_hnd, mem_ctx, op->in.pol,
num_names,
( const char ** ) op->in.names, NULL,
&sids, &types );
1, &sids, &types );
if ( NT_STATUS_IS_OK( hnd->status ) ) {
/*this is the easy part, just make the out.sids array */
@ -662,7 +662,7 @@ int cac_LsaEnumAccountRights( CacServerHandle * hnd, TALLOC_CTX * mem_ctx,
op->in.pol, 1,
( const char ** ) &( op->in.
name ),
NULL, &user_sid, &type );
NULL, 1, &user_sid, &type );
if ( !NT_STATUS_IS_OK( hnd->status ) )
return CAC_FAILURE;
@ -928,7 +928,7 @@ int cac_LsaOpenAccount( CacServerHandle * hnd, TALLOC_CTX * mem_ctx,
op->in.pol, 1,
( const char ** ) &( op->in.
name ),
NULL, &user_sid, &type );
NULL, 1, &user_sid, &type );
if ( !NT_STATUS_IS_OK( hnd->status ) )
return CAC_FAILURE;
@ -998,7 +998,7 @@ int cac_LsaAddPrivileges( CacServerHandle * hnd, TALLOC_CTX * mem_ctx,
op->in.pol, 1,
( const char ** ) &( op->in.
name ),
NULL, &user_sid, &type );
NULL, 1, &user_sid, &type );
if ( !NT_STATUS_IS_OK( hnd->status ) )
return CAC_FAILURE;
@ -1060,7 +1060,7 @@ int cac_LsaRemovePrivileges( CacServerHandle * hnd, TALLOC_CTX * mem_ctx,
op->in.pol, 1,
( const char ** ) &( op->in.
name ),
NULL, &user_sid, &type );
NULL, 1, &user_sid, &type );
if ( !NT_STATUS_IS_OK( hnd->status ) )
return CAC_FAILURE;
@ -1122,7 +1122,7 @@ int cac_LsaClearPrivileges( CacServerHandle * hnd, TALLOC_CTX * mem_ctx,
op->in.pol, 1,
( const char ** ) &( op->in.
name ),
NULL, &user_sid, &type );
NULL, 1, &user_sid, &type );
if ( !NT_STATUS_IS_OK( hnd->status ) )
return CAC_FAILURE;
@ -1181,7 +1181,7 @@ int cac_LsaSetPrivileges( CacServerHandle * hnd, TALLOC_CTX * mem_ctx,
op->in.pol, 1,
( const char ** ) &( op->in.
name ),
NULL, &user_sid, &type );
NULL, 1, &user_sid, &type );
if ( !NT_STATUS_IS_OK( hnd->status ) )
return CAC_FAILURE;

View File

@ -3849,7 +3849,7 @@ convert_string_to_sid(struct cli_state *ipc_cli,
}
if (!NT_STATUS_IS_OK(rpccli_lsa_lookup_names(pipe_hnd, ipc_cli->mem_ctx,
pol, 1, &str, NULL, &sids,
pol, 1, &str, NULL, 1, &sids,
&types))) {
result = False;
goto done;

View File

@ -290,7 +290,7 @@ NTSTATUS msrpc_name_to_sid(struct winbindd_domain *domain,
return result;
result = rpccli_lsa_lookup_names(cli, mem_ctx, &lsa_policy, 1,
(const char**) &full_name, NULL, &sids, &types);
(const char**) &full_name, NULL, 1, &sids, &types);
if (!NT_STATUS_IS_OK(result))
return result;

View File

@ -187,7 +187,7 @@ static PyObject *lsa_lookup_names(PyObject *self, PyObject *args)
ntstatus = rpccli_lsa_lookup_names(
hnd->cli, mem_ctx, &hnd->pol, num_names, names,
NULL, &sids, &name_types);
NULL, 1, &sids, &name_types);
if (!NT_STATUS_IS_OK(ntstatus) && NT_STATUS_V(ntstatus) != 0x107) {
PyErr_SetObject(lsa_ntstatus, py_ntstatus_tuple(ntstatus));

View File

@ -448,6 +448,7 @@ NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client *cli,
POLICY_HND *pol, int num_names,
const char **names,
const char ***dom_names,
int level,
DOM_SID **sids,
enum lsa_SidType **types)
{
@ -464,7 +465,7 @@ NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client *cli,
ZERO_STRUCT(ref);
r.dom_ref = &ref;
init_q_lookup_names(mem_ctx, &q, pol, num_names, names);
init_q_lookup_names(mem_ctx, &q, pol, num_names, names, level);
CLI_DO_RPC( cli, mem_ctx, PI_LSARPC, LSA_LOOKUPNAMES,
q, r,

View File

@ -1567,7 +1567,8 @@ 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 **names,
int level)
{
unsigned int i;
@ -1578,7 +1579,7 @@ void init_q_lookup_names(TALLOC_CTX *mem_ctx, LSA_Q_LOOKUP_NAMES *q_l,
q_l->pol = *hnd;
q_l->num_entries = num_names;
q_l->num_entries2 = num_names;
q_l->lookup_level = 1;
q_l->lookup_level = level;
if (num_names) {
if ((q_l->uni_name = TALLOC_ZERO_ARRAY(mem_ctx, UNISTR2, num_names)) == NULL) {

View File

@ -47,7 +47,7 @@ static NTSTATUS name_to_sid(struct rpc_pipe_client *cli,
if (!NT_STATUS_IS_OK(result))
goto done;
result = rpccli_lsa_lookup_names(cli, mem_ctx, &pol, 1, &name, NULL, &sids, &sid_types);
result = rpccli_lsa_lookup_names(cli, mem_ctx, &pol, 1, &name, NULL, 1, &sids, &sid_types);
if (!NT_STATUS_IS_OK(result))
goto done;
@ -239,7 +239,7 @@ static NTSTATUS cmd_lsa_lookup_names(struct rpc_pipe_client *cli,
goto done;
result = rpccli_lsa_lookup_names(cli, mem_ctx, &pol, argc - 1,
(const char**)(argv + 1), NULL, &sids, &types);
(const char**)(argv + 1), NULL, 1, &sids, &types);
if (!NT_STATUS_IS_OK(result) && NT_STATUS_V(result) !=
NT_STATUS_V(STATUS_SOME_UNMAPPED))

View File

@ -2030,7 +2030,7 @@ static NTSTATUS get_sid_from_name(struct cli_state *cli,
}
result = rpccli_lsa_lookup_names(pipe_hnd, mem_ctx, &lsa_pol, 1,
&name, NULL, &sids, &types);
&name, NULL, 1, &sids, &types);
if (NT_STATUS_IS_OK(result)) {
sid_copy(sid, &sids[0]);

View File

@ -76,7 +76,7 @@ static NTSTATUS name_to_sid(struct rpc_pipe_client *pipe_hnd,
return result;
result = rpccli_lsa_lookup_names(pipe_hnd, mem_ctx, &pol, 1, &name,
NULL, &sids, &sid_types);
NULL, 1, &sids, &sid_types);
if ( NT_STATUS_IS_OK(result) )
sid_copy( sid, &sids[0] );

View File

@ -59,7 +59,7 @@ NTSTATUS net_rpc_lookup_name(TALLOC_CTX *mem_ctx, struct cli_state *cli,
}
result = rpccli_lsa_lookup_names(lsa_pipe, mem_ctx, &pol, 1,
&name, &dom_names, &sids, &types);
&name, &dom_names, 1, &sids, &types);
if (!NT_STATUS_IS_OK(result)) {
/* This can happen easily, don't log an error */

View File

@ -206,8 +206,8 @@ NTSTATUS net_lookup_sid_from_name(TALLOC_CTX *ctx, const char *full_name, DOM_SI
&csp->pol,
1,
&full_name,
NULL, &sids,
&types);
NULL, 1,
&sids, &types);
if (!NT_STATUS_IS_OK(nt_status)) {
return nt_status;

View File

@ -145,7 +145,7 @@ static BOOL StringToSid(DOM_SID *sid, const char *str)
if (!cacls_open_policy_hnd() ||
!NT_STATUS_IS_OK(rpccli_lsa_lookup_names(global_pipe_hnd, global_hack_cli->mem_ctx,
&pol, 1, &str, NULL, &sids,
&pol, 1, &str, NULL, 1, &sids,
&types))) {
result = False;
goto done;

View File

@ -116,7 +116,7 @@ static BOOL StringToSid(DOM_SID *sid, const char *str)
if (!cli_open_policy_hnd() ||
!NT_STATUS_IS_OK(rpccli_lsa_lookup_names(global_pipe_hnd, cli_ipc->mem_ctx,
&pol, 1, &str, NULL, &sids,
&pol, 1, &str, NULL, 1, &sids,
&types))) {
result = False;
goto done;