summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-11 10:19:54 +0100
committerGünther Deschner <gd@samba.org>2008-02-11 10:49:21 +0100
commite1bd9c30b0eb442b3ccd178bd488d9e75679acfb (patch)
tree3f8c4bf25ff949019aee4d077e42addf0cbdc020 /source3/rpc_server
parentffffd3e3c3b45f0bd9b96d62e896373633e00656 (diff)
downloadsamba-e1bd9c30b0eb442b3ccd178bd488d9e75679acfb.tar.gz
samba-e1bd9c30b0eb442b3ccd178bd488d9e75679acfb.tar.bz2
samba-e1bd9c30b0eb442b3ccd178bd488d9e75679acfb.zip
Use pidl for _lsa_EnumPrivs().
Guenther (This used to be commit 62944007315c1744e2d2db7db593bc72af4b643b)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_lsa.c23
-rw-r--r--source3/rpc_server/srv_lsa_nt.c49
2 files changed, 25 insertions, 47 deletions
diff --git a/source3/rpc_server/srv_lsa.c b/source3/rpc_server/srv_lsa.c
index 24bc65c51a..d24929b3af 100644
--- a/source3/rpc_server/srv_lsa.c
+++ b/source3/rpc_server/srv_lsa.c
@@ -186,28 +186,7 @@ static bool api_lsa_open_secret(pipes_struct *p)
static bool api_lsa_enum_privs(pipes_struct *p)
{
- LSA_Q_ENUM_PRIVS q_u;
- LSA_R_ENUM_PRIVS r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if(!lsa_io_q_enum_privs("", &q_u, data, 0)) {
- DEBUG(0,("api_lsa_enum_privs: failed to unmarshall LSA_Q_ENUM_PRIVS.\n"));
- return False;
- }
-
- r_u.status = _lsa_enum_privs(p, &q_u, &r_u);
-
- /* store the response in the SMB stream */
- if(!lsa_io_r_enum_privs("", &r_u, rdata, 0)) {
- DEBUG(0,("api_lsa_enum_privs: Failed to marshall LSA_R_ENUM_PRIVS.\n"));
- return False;
- }
-
- return True;
+ return proxy_lsa_call(p, NDR_LSA_ENUMPRIVS);
}
/***************************************************************************
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c
index 6e25a64236..60414a9372 100644
--- a/source3/rpc_server/srv_lsa_nt.c
+++ b/source3/rpc_server/srv_lsa_nt.c
@@ -1403,16 +1403,17 @@ NTSTATUS _lsa_DeleteObject(pipes_struct *p,
}
/***************************************************************************
-_lsa_enum_privs.
+ _lsa_EnumPrivs
***************************************************************************/
-NTSTATUS _lsa_enum_privs(pipes_struct *p, LSA_Q_ENUM_PRIVS *q_u, LSA_R_ENUM_PRIVS *r_u)
+NTSTATUS _lsa_EnumPrivs(pipes_struct *p,
+ struct lsa_EnumPrivs *r)
{
struct lsa_info *handle;
uint32 i;
- uint32 enum_context = q_u->enum_context;
+ uint32 enum_context = *r->in.resume_handle;
int num_privs = count_all_privileges();
- LSA_PRIV_ENTRY *entries = NULL;
+ struct lsa_PrivEntry *entries = NULL;
LUID_ATTR luid;
/* remember that the enum_context starts at 0 and not 1 */
@@ -1423,7 +1424,7 @@ NTSTATUS _lsa_enum_privs(pipes_struct *p, LSA_Q_ENUM_PRIVS *q_u, LSA_R_ENUM_PRIV
DEBUG(10,("_lsa_enum_privs: enum_context:%d total entries:%d\n",
enum_context, num_privs));
- if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&handle))
+ if (!find_policy_by_hnd(p, r->in.handle, (void **)(void *)&handle))
return NT_STATUS_INVALID_HANDLE;
/* check if the user have enough rights
@@ -1433,33 +1434,37 @@ NTSTATUS _lsa_enum_privs(pipes_struct *p, LSA_Q_ENUM_PRIVS *q_u, LSA_R_ENUM_PRIV
return NT_STATUS_ACCESS_DENIED;
if (num_privs) {
- if ( !(entries = TALLOC_ZERO_ARRAY(p->mem_ctx, LSA_PRIV_ENTRY, num_privs )) )
+ entries = TALLOC_ZERO_ARRAY(p->mem_ctx, struct lsa_PrivEntry, num_privs);
+ if (!entries) {
return NT_STATUS_NO_MEMORY;
+ }
} else {
entries = NULL;
}
for (i = 0; i < num_privs; i++) {
if( i < enum_context) {
- init_unistr2(&entries[i].name, NULL, UNI_FLAGS_NONE);
- init_uni_hdr(&entries[i].hdr_name, &entries[i].name);
-
- entries[i].luid_low = 0;
- entries[i].luid_high = 0;
+
+ init_lsa_StringLarge(&entries[i].name, NULL);
+
+ entries[i].luid.low = 0;
+ entries[i].luid.high = 0;
} else {
- init_unistr2(&entries[i].name, privs[i].name, UNI_FLAGS_NONE);
- init_uni_hdr(&entries[i].hdr_name, &entries[i].name);
-
+
+ init_lsa_StringLarge(&entries[i].name, privs[i].name);
+
luid = get_privilege_luid( &privs[i].se_priv );
-
- entries[i].luid_low = luid.luid.low;
- entries[i].luid_high = luid.luid.high;
+
+ entries[i].luid.low = luid.luid.low;
+ entries[i].luid.high = luid.luid.high;
}
}
enum_context = num_privs;
-
- init_lsa_r_enum_privs(r_u, enum_context, num_privs, entries);
+
+ *r->out.resume_handle = enum_context;
+ r->out.privs->count = num_privs;
+ r->out.privs->privs = entries;
return NT_STATUS_OK;
}
@@ -2188,12 +2193,6 @@ NTSTATUS _lsa_Delete(pipes_struct *p, struct lsa_Delete *r)
return NT_STATUS_NOT_IMPLEMENTED;
}
-NTSTATUS _lsa_EnumPrivs(pipes_struct *p, struct lsa_EnumPrivs *r)
-{
- p->rng_fault_state = True;
- return NT_STATUS_NOT_IMPLEMENTED;
-}
-
NTSTATUS _lsa_SetSecObj(pipes_struct *p, struct lsa_SetSecObj *r)
{
p->rng_fault_state = True;