summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-03-10 18:50:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:57 -0500
commit66df8431ec092c4e629fc07e8e5a242ff3821b2d (patch)
tree17d58c731f37eaf257e194e38d04dbe299d29551 /source3/rpc_parse
parent3e4bc25f44c9456cab00b4919b2ead22d5ea91f7 (diff)
downloadsamba-66df8431ec092c4e629fc07e8e5a242ff3821b2d.tar.gz
samba-66df8431ec092c4e629fc07e8e5a242ff3821b2d.tar.bz2
samba-66df8431ec092c4e629fc07e8e5a242ff3821b2d.zip
r5726: merge LsaLookupPrivValue() code from trunk
(This used to be commit 277203b5356af58ce62eb4eec0db2eccadeeffd6)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_lsa.c43
1 files changed, 29 insertions, 14 deletions
diff --git a/source3/rpc_parse/parse_lsa.c b/source3/rpc_parse/parse_lsa.c
index e38197ddba..bbff258722 100644
--- a/source3/rpc_parse/parse_lsa.c
+++ b/source3/rpc_parse/parse_lsa.c
@@ -1981,20 +1981,38 @@ BOOL lsa_io_r_setsystemaccount(const char *desc, LSA_R_SETSYSTEMACCOUNT *r_c, p
}
-void init_lsa_q_lookupprivvalue(LSA_Q_LOOKUPPRIVVALUE *trn, POLICY_HND *hnd, const char *name)
+static void init_lsa_string( LSA_STRING *uni, const char *string )
{
- memcpy(&trn->pol, hnd, sizeof(trn->pol));
- init_unistr2(&trn->uni2_right, name, UNI_FLAGS_NONE);
- init_uni_hdr(&trn->hdr_right, &trn->uni2_right);
+ init_unistr2(&uni->unistring, string, UNI_FLAGS_NONE);
+ init_uni_hdr(&uni->hdr, &uni->unistring);
+}
+
+void init_lsa_q_lookup_priv_value(LSA_Q_LOOKUP_PRIV_VALUE *q_u, POLICY_HND *hnd, const char *name)
+{
+ memcpy(&q_u->pol, hnd, sizeof(q_u->pol));
+ init_lsa_string( &q_u->privname, name );
+}
+
+BOOL smb_io_lsa_string( const char *desc, LSA_STRING *string, prs_struct *ps, int depth )
+{
+ prs_debug(ps, depth, desc, "smb_io_lsa_string");
+ depth++;
+
+ if(!smb_io_unihdr ("hdr", &string->hdr, ps, depth))
+ return False;
+ if(!smb_io_unistr2("unistring", &string->unistring, string->hdr.buffer, ps, depth))
+ return False;
+
+ return True;
}
/*******************************************************************
- Reads or writes an LSA_Q_LOOKUPPRIVVALUE structure.
+ Reads or writes an LSA_Q_LOOKUP_PRIV_VALUE structure.
********************************************************************/
-BOOL lsa_io_q_lookupprivvalue(const char *desc, LSA_Q_LOOKUPPRIVVALUE *r_c, prs_struct *ps, int depth)
+BOOL lsa_io_q_lookup_priv_value(const char *desc, LSA_Q_LOOKUP_PRIV_VALUE *r_c, prs_struct *ps, int depth)
{
- prs_debug(ps, depth, desc, "lsa_io_q_lookupprivvalue");
+ prs_debug(ps, depth, desc, "lsa_io_q_lookup_priv_value");
depth++;
if(!prs_align(ps))
@@ -2002,21 +2020,19 @@ BOOL lsa_io_q_lookupprivvalue(const char *desc, LSA_Q_LOOKUPPRIVVALUE *r_c, prs
if(!smb_io_pol_hnd("pol", &r_c->pol, ps, depth))
return False;
- if(!smb_io_unihdr ("hdr_name", &r_c->hdr_right, ps, depth))
- return False;
- if(!smb_io_unistr2("uni2_right", &r_c->uni2_right, r_c->hdr_right.buffer, ps, depth))
+ if(!smb_io_lsa_string("privname", &r_c->privname, ps, depth))
return False;
return True;
}
/*******************************************************************
- Reads or writes an LSA_R_LOOKUPPRIVVALUE structure.
+ Reads or writes an LSA_R_LOOKUP_PRIV_VALUE structure.
********************************************************************/
-BOOL lsa_io_r_lookupprivvalue(const char *desc, LSA_R_LOOKUPPRIVVALUE *r_c, prs_struct *ps, int depth)
+BOOL lsa_io_r_lookup_priv_value(const char *desc, LSA_R_LOOKUP_PRIV_VALUE *r_c, prs_struct *ps, int depth)
{
- prs_debug(ps, depth, desc, "lsa_io_r_lookupprivvalue");
+ prs_debug(ps, depth, desc, "lsa_io_r_lookup_priv_value");
depth++;
if(!prs_align(ps))
@@ -2271,7 +2287,6 @@ BOOL lsa_io_r_query_info2(const char *desc, LSA_R_QUERY_INFO2 *r_c,
return True;
}
-
/*******************************************************************
Inits an LSA_Q_ENUM_ACCT_RIGHTS structure.
********************************************************************/