r23627: Allow to pass down the lookup-level to rpccli_lsa_lookup_names().
authorGünther Deschner <gd@samba.org>
Wed, 27 Jun 2007 11:42:17 +0000 (11:42 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:23:38 +0000 (12:23 -0500)
Guenther
(This used to be commit e9a7512a9f630340004913f1379452eea8a9b6ae)

13 files changed:
source3/libmsrpc/cac_lsarpc.c
source3/libsmb/libsmbclient.c
source3/nsswitch/winbindd_rpc.c
source3/python/py_lsa.c
source3/rpc_client/cli_lsarpc.c
source3/rpc_parse/parse_lsa.c
source3/rpcclient/cmd_lsarpc.c
source3/utils/net_rpc.c
source3/utils/net_rpc_rights.c
source3/utils/net_util.c
source3/utils/netlookup.c
source3/utils/smbcacls.c
source3/utils/smbcquotas.c

index de53c0f483a455bb980caf960b966e0a27d545c2..d8813fc20435d4c0c472f139223db963b1712f16 100644 (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;
index c36bb21ff40962dca1aaa00129a78451920713cf..550c691a8d0cd60a15d6eff6394936d939b51c5e 100644 (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;
index 03aa42012e4fcb1b527e4c8438cc4356a2f900fd..7899d62fea97f4f0ef7d24b726a156408ff5141e 100644 (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;
index 39abc60e25e9f212819d2626e17faa6db1db49a8..740470003142f29a74eacca32f1dd03f5c0bbd91 100644 (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));
index ed70bc1752ff33fe9a6bdfe876dd10e17032a406..00c65d15aaaf71a9b66309169655461054fa61cf 100644 (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,
index 0c07e7fe2213473d8fd73927cc337e577272d3f3..09f0f835ecc22431ed4006e0ecade34153afde58 100644 (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) {
index 96642ed65b787aa2c6af89284790dbff6ec143dc..e3fe57e127f110f4e2a113ad511f816bb64b34db 100644 (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))
index 315b56100f2610d7b124bf9cddaeeba70067218d..844207bff2a838f7725113f1685a7ecd64c93ea0 100644 (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]);
index 5c999e4cb0ef6e2fea7a65030d33e4645a0e390b..4189f20658a300e8f9b0bd4d655ef5bf8729abe9 100644 (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] );
index db6420d6b774629c73184382319ce9824a39acdc..be12b0f866179742c04667c2e5d6fcef7b749ba8 100644 (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 */
index 33b6c4bb257f3cde765b33ac786e7961befc74a6..82e1b8af801558fadf3a520207774d3ba0855712 100644 (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;
index 5717df2dfaf773c5ad5f72c19cabeea0311e05f6..4a7425109007c2a2d0f6a38678b7fba045aaef92 100644 (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;
index ae2e6a5956f48c678c576d659995f0e8f72bd45e..bf05441c21ebd42736a0f3a066e946b8a9b44247 100644 (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;