summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_server/srv_lsa_nt.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c
index b114bd2d57..da5b866f17 100644
--- a/source3/rpc_server/srv_lsa_nt.c
+++ b/source3/rpc_server/srv_lsa_nt.c
@@ -545,19 +545,19 @@ NTSTATUS _lsa_enum_privs(pipes_struct *p, LSA_Q_ENUM_PRIVS *q_u, LSA_R_ENUM_PRIV
if (enum_context >= PRIV_ALL_INDEX)
return NT_STATUS_UNABLE_TO_FREE_VM;
- entries = (LSA_PRIV_ENTRY *)talloc_zero(p->mem_ctx, sizeof(LSA_PRIV_ENTRY) * (PRIV_ALL_INDEX-enum_context));
+ entries = (LSA_PRIV_ENTRY *)talloc_zero(p->mem_ctx, sizeof(LSA_PRIV_ENTRY) * (PRIV_ALL_INDEX-enum_context-1));
if (entries==NULL)
return NT_STATUS_NO_MEMORY;
entry = entries;
- for (i = 0; i < PRIV_ALL_INDEX-enum_context; i++, entry++) {
+ for (i = 0; i < PRIV_ALL_INDEX-enum_context-1; i++, entry++) {
init_uni_hdr(&entry->hdr_name, strlen(privs[i+1-enum_context].priv));
init_unistr2(&entry->name, privs[i+1-enum_context].priv, strlen(privs[i+1-enum_context].priv) );
entry->luid_low = privs[i+1-enum_context].se_priv;
entry->luid_high = 1;
}
- init_lsa_r_enum_privs(r_u, i+enum_context, PRIV_ALL_INDEX-enum_context, entries);
+ init_lsa_r_enum_privs(r_u, i+enum_context, PRIV_ALL_INDEX-enum_context-1, entries);
return NT_STATUS_OK;
}
@@ -570,31 +570,31 @@ NTSTATUS _lsa_priv_get_dispname(pipes_struct *p, LSA_Q_PRIV_GET_DISPNAME *q_u, L
{
fstring name_asc;
fstring desc_asc;
- int i;
+ int i=1;
if (!find_policy_by_hnd(p, &q_u->pol, NULL))
return NT_STATUS_INVALID_HANDLE;
unistr2_to_ascii(name_asc, &q_u->name, sizeof(name_asc));
- DEBUG(0,("_lsa_priv_get_dispname: %s", name_asc));
-
- for (i=1; privs[i].se_priv!=SE_PRIV_ALL; i++) {
- if ( !strcmp(name_asc, privs[i].priv)) {
-
- fstrcpy(desc_asc, privs[i].description);
-
- }
- }
- DEBUG(0,(": %s\n", desc_asc));
-
- init_uni_hdr(&r_u->hdr_desc, strlen(desc_asc));
- init_unistr2(&r_u->desc, desc_asc, strlen(desc_asc) );
+ DEBUG(10,("_lsa_priv_get_dispname: %s", name_asc));
- r_u->ptr_info=0xdeadbeef;
- r_u->lang_id=q_u->lang_id;
+ while (privs[i].se_priv!=SE_PRIV_ALL && strcmp(name_asc, privs[i].priv))
+ i++;
+
+ if (privs[i].se_priv!=SE_PRIV_ALL) {
+ DEBUG(10,(": %s\n", desc_asc));
+ init_uni_hdr(&r_u->hdr_desc, strlen(privs[i].description));
+ init_unistr2(&r_u->desc, privs[i].description, strlen(privs[i].description) );
- return NT_STATUS_OK;
+ r_u->ptr_info=0xdeadbeef;
+ r_u->lang_id=q_u->lang_id;
+ return NT_STATUS_OK;
+ } else {
+ DEBUG(10,(": doesn't exist\n"));
+ r_u->ptr_info=0;
+ return NT_STATUS_NO_SUCH_PRIVILEGE;
+ }
}
/***************************************************************************