*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
Reads or writes a structure.
********************************************************************/
-static BOOL net_io_neg_flags(const char *desc, NEG_FLAGS *neg, prs_struct *ps, int depth)
+static bool net_io_neg_flags(const char *desc, NEG_FLAGS *neg, prs_struct *ps, int depth)
{
if (neg == NULL)
return False;
Reads or writes a NETLOGON_INFO_3 structure.
********************************************************************/
-static BOOL net_io_netinfo_3(const char *desc, NETLOGON_INFO_3 *info, prs_struct *ps, int depth)
+static bool net_io_netinfo_3(const char *desc, NETLOGON_INFO_3 *info, prs_struct *ps, int depth)
{
if (info == NULL)
return False;
Reads or writes a NETLOGON_INFO_1 structure.
********************************************************************/
-static BOOL net_io_netinfo_1(const char *desc, NETLOGON_INFO_1 *info, prs_struct *ps, int depth)
+static bool net_io_netinfo_1(const char *desc, NETLOGON_INFO_1 *info, prs_struct *ps, int depth)
{
if (info == NULL)
return False;
Reads or writes a NETLOGON_INFO_2 structure.
********************************************************************/
-static BOOL net_io_netinfo_2(const char *desc, NETLOGON_INFO_2 *info, prs_struct *ps, int depth)
+static bool net_io_netinfo_2(const char *desc, NETLOGON_INFO_2 *info, prs_struct *ps, int depth)
{
if (info == NULL)
return False;
return True;
}
-static BOOL net_io_ctrl_data_info_5(const char *desc, CTRL_DATA_INFO_5 *info, prs_struct *ps, int depth)
+static bool net_io_ctrl_data_info_5(const char *desc, CTRL_DATA_INFO_5 *info, prs_struct *ps, int depth)
{
if (info == NULL)
return False;
return True;
}
-static BOOL net_io_ctrl_data_info_6(const char *desc, CTRL_DATA_INFO_6 *info, prs_struct *ps, int depth)
+static bool net_io_ctrl_data_info_6(const char *desc, CTRL_DATA_INFO_6 *info, prs_struct *ps, int depth)
{
if (info == NULL)
return False;
Reads or writes an NET_Q_LOGON_CTRL2 structure.
********************************************************************/
-BOOL net_io_q_logon_ctrl2(const char *desc, NET_Q_LOGON_CTRL2 *q_l, prs_struct *ps, int depth)
+bool net_io_q_logon_ctrl2(const char *desc, NET_Q_LOGON_CTRL2 *q_l, prs_struct *ps, int depth)
{
if (q_l == NULL)
return False;
Reads or writes an NET_R_LOGON_CTRL2 structure.
********************************************************************/
-BOOL net_io_r_logon_ctrl2(const char *desc, NET_R_LOGON_CTRL2 *r_l, prs_struct *ps, int depth)
+bool net_io_r_logon_ctrl2(const char *desc, NET_R_LOGON_CTRL2 *r_l, prs_struct *ps, int depth)
{
if (r_l == NULL)
return False;
Reads or writes an NET_Q_LOGON_CTRL structure.
********************************************************************/
-BOOL net_io_q_logon_ctrl(const char *desc, NET_Q_LOGON_CTRL *q_l, prs_struct *ps,
+bool net_io_q_logon_ctrl(const char *desc, NET_Q_LOGON_CTRL *q_l, prs_struct *ps,
int depth)
{
prs_debug(ps, depth, desc, "net_io_q_logon_ctrl");
Reads or writes an NET_R_LOGON_CTRL structure.
********************************************************************/
-BOOL net_io_r_logon_ctrl(const char *desc, NET_R_LOGON_CTRL *r_l, prs_struct *ps,
+bool net_io_r_logon_ctrl(const char *desc, NET_R_LOGON_CTRL *r_l, prs_struct *ps,
int depth)
{
prs_debug(ps, depth, desc, "net_io_r_logon_ctrl");
}
/*******************************************************************
- Inits an NET_R_GETDCNAME structure.
+ Inits an NET_R_GETANYDCNAME structure.
********************************************************************/
-void init_net_q_getdcname(NET_Q_GETDCNAME *r_t, const char *logon_server,
- const char *domainname)
+void init_net_q_getanydcname(NET_Q_GETANYDCNAME *r_t, const char *logon_server,
+ const char *domainname)
{
- DEBUG(5,("init_q_getdcname\n"));
+ DEBUG(5,("init_q_getanydcname\n"));
r_t->ptr_logon_server = (logon_server != NULL);
init_unistr2(&r_t->uni_logon_server, logon_server, UNI_STR_TERMINATE);
}
/*******************************************************************
- Reads or writes an NET_Q_GETDCNAME structure.
+ Reads or writes an NET_Q_GETANYDCNAME structure.
********************************************************************/
-BOOL net_io_q_getdcname(const char *desc, NET_Q_GETDCNAME *r_t, prs_struct *ps,
- int depth)
+bool net_io_q_getanydcname(const char *desc, NET_Q_GETANYDCNAME *r_t, prs_struct *ps,
+ int depth)
{
if (r_t == NULL)
return False;
- prs_debug(ps, depth, desc, "net_io_q_getdcname");
+ prs_debug(ps, depth, desc, "net_io_q_getanydcname");
depth++;
if (!prs_uint32("ptr_logon_server", ps, depth, &r_t->ptr_logon_server))
/*******************************************************************
- Inits an NET_R_GETDCNAME structure.
+ Inits an NET_R_GETANYDCNAME structure.
********************************************************************/
-void init_net_r_getdcname(NET_R_GETDCNAME *r_t, const char *dcname)
+void init_net_r_getanydcname(NET_R_GETANYDCNAME *r_t, const char *dcname)
{
- DEBUG(5,("init_r_getdcname\n"));
+ DEBUG(5,("init_r_getanydcname\n"));
init_unistr2(&r_t->uni_dcname, dcname, UNI_STR_TERMINATE);
}
/*******************************************************************
- Reads or writes an NET_R_GETDCNAME structure.
+ Reads or writes an NET_R_GETANYDCNAME structure.
********************************************************************/
-BOOL net_io_r_getdcname(const char *desc, NET_R_GETDCNAME *r_t, prs_struct *ps,
- int depth)
+bool net_io_r_getanydcname(const char *desc, NET_R_GETANYDCNAME *r_t, prs_struct *ps,
+ int depth)
{
if (r_t == NULL)
return False;
- prs_debug(ps, depth, desc, "net_io_r_getdcname");
+ prs_debug(ps, depth, desc, "net_io_r_getanydcname");
depth++;
if (!prs_uint32("ptr_dcname", ps, depth, &r_t->ptr_dcname))
/*******************************************************************
- Inits an NET_R_GETANYDCNAME structure.
+ Inits an NET_R_GETDCNAME structure.
********************************************************************/
-void init_net_q_getanydcname(NET_Q_GETANYDCNAME *r_t, const char *logon_server,
- const char *domainname)
+void init_net_q_getdcname(NET_Q_GETDCNAME *r_t, const char *logon_server,
+ const char *domainname)
{
- DEBUG(5,("init_q_getanydcname\n"));
+ DEBUG(5,("init_q_getdcname\n"));
init_unistr2(&r_t->uni_logon_server, logon_server, UNI_STR_TERMINATE);
r_t->ptr_domainname = (domainname != NULL);
}
/*******************************************************************
- Reads or writes an NET_Q_GETANYDCNAME structure.
+ Reads or writes an NET_Q_GETDCNAME structure.
********************************************************************/
-BOOL net_io_q_getanydcname(const char *desc, NET_Q_GETANYDCNAME *r_t, prs_struct *ps,
- int depth)
+bool net_io_q_getdcname(const char *desc, NET_Q_GETDCNAME *r_t, prs_struct *ps,
+ int depth)
{
if (r_t == NULL)
return False;
- prs_debug(ps, depth, desc, "net_io_q_getanydcname");
+ prs_debug(ps, depth, desc, "net_io_q_getdcname");
depth++;
if (!smb_io_unistr2("logon_server", &r_t->uni_logon_server,
/*******************************************************************
- Inits an NET_R_GETANYDCNAME structure.
+ Inits an NET_R_GETDCNAME structure.
********************************************************************/
-void init_net_r_getanydcname(NET_R_GETANYDCNAME *r_t, const char *dcname)
+void init_net_r_getdcname(NET_R_GETDCNAME *r_t, const char *dcname)
{
- DEBUG(5,("init_r_getanydcname\n"));
+ DEBUG(5,("init_r_getdcname\n"));
init_unistr2(&r_t->uni_dcname, dcname, UNI_STR_TERMINATE);
}
/*******************************************************************
- Reads or writes an NET_R_GETANYDCNAME structure.
+ Reads or writes an NET_R_GETDCNAME structure.
********************************************************************/
-BOOL net_io_r_getanydcname(const char *desc, NET_R_GETANYDCNAME *r_t, prs_struct *ps,
- int depth)
+bool net_io_r_getdcname(const char *desc, NET_R_GETDCNAME *r_t, prs_struct *ps,
+ int depth)
{
if (r_t == NULL)
return False;
- prs_debug(ps, depth, desc, "net_io_r_getanydcname");
+ prs_debug(ps, depth, desc, "net_io_r_getdcname");
depth++;
if (!prs_uint32("ptr_dcname", ps, depth, &r_t->ptr_dcname))
Reads or writes an NET_R_TRUST_DOM_LIST structure.
********************************************************************/
-BOOL net_io_r_trust_dom(const char *desc, NET_R_TRUST_DOM_LIST *r_t, prs_struct *ps, int depth)
+bool net_io_r_trust_dom(const char *desc, NET_R_TRUST_DOM_LIST *r_t, prs_struct *ps, int depth)
{
uint32 value;
Reads or writes an NET_Q_TRUST_DOM_LIST structure.
********************************************************************/
-BOOL net_io_q_trust_dom(const char *desc, NET_Q_TRUST_DOM_LIST *q_l, prs_struct *ps, int depth)
+bool net_io_q_trust_dom(const char *desc, NET_Q_TRUST_DOM_LIST *q_l, prs_struct *ps, int depth)
{
if (q_l == NULL)
return False;
Reads or writes an NET_Q_REQ_CHAL structure.
********************************************************************/
-BOOL net_io_q_req_chal(const char *desc, NET_Q_REQ_CHAL *q_c, prs_struct *ps, int depth)
+bool net_io_q_req_chal(const char *desc, NET_Q_REQ_CHAL *q_c, prs_struct *ps, int depth)
{
if (q_c == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL net_io_r_req_chal(const char *desc, NET_R_REQ_CHAL *r_c, prs_struct *ps, int depth)
+bool net_io_r_req_chal(const char *desc, NET_R_REQ_CHAL *r_c, prs_struct *ps, int depth)
{
if (r_c == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL net_io_q_auth(const char *desc, NET_Q_AUTH *q_a, prs_struct *ps, int depth)
+bool net_io_q_auth(const char *desc, NET_Q_AUTH *q_a, prs_struct *ps, int depth)
{
if (q_a == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL net_io_r_auth(const char *desc, NET_R_AUTH *r_a, prs_struct *ps, int depth)
+bool net_io_r_auth(const char *desc, NET_R_AUTH *r_a, prs_struct *ps, int depth)
{
if (r_a == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL net_io_q_auth_2(const char *desc, NET_Q_AUTH_2 *q_a, prs_struct *ps, int depth)
+bool net_io_q_auth_2(const char *desc, NET_Q_AUTH_2 *q_a, prs_struct *ps, int depth)
{
if (q_a == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL net_io_r_auth_2(const char *desc, NET_R_AUTH_2 *r_a, prs_struct *ps, int depth)
+bool net_io_r_auth_2(const char *desc, NET_R_AUTH_2 *r_a, prs_struct *ps, int depth)
{
if (r_a == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL net_io_q_auth_3(const char *desc, NET_Q_AUTH_3 *q_a, prs_struct *ps, int depth)
+bool net_io_q_auth_3(const char *desc, NET_Q_AUTH_3 *q_a, prs_struct *ps, int depth)
{
if (q_a == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL net_io_r_auth_3(const char *desc, NET_R_AUTH_3 *r_a, prs_struct *ps, int depth)
+bool net_io_r_auth_3(const char *desc, NET_R_AUTH_3 *r_a, prs_struct *ps, int depth)
{
if (r_a == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL net_io_q_srv_pwset(const char *desc, NET_Q_SRV_PWSET *q_s, prs_struct *ps, int depth)
+bool net_io_q_srv_pwset(const char *desc, NET_Q_SRV_PWSET *q_s, prs_struct *ps, int depth)
{
if (q_s == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL net_io_r_srv_pwset(const char *desc, NET_R_SRV_PWSET *r_s, prs_struct *ps, int depth)
+bool net_io_r_srv_pwset(const char *desc, NET_R_SRV_PWSET *r_s, prs_struct *ps, int depth)
{
if (r_s == NULL)
return False;
static int init_dom_sid2s(TALLOC_CTX *ctx, const char *sids_str, DOM_SID2 **ppsids)
{
const char *ptr;
- pstring s2;
+ char *s2;
int count = 0;
DEBUG(4,("init_dom_sid2s: %s\n", sids_str ? sids_str:""));
if(sids_str) {
int number;
DOM_SID2 *sids;
+ TALLOC_CTX *frame = talloc_stackframe();
/* Count the number of valid SIDs. */
- for (count = 0, ptr = sids_str; next_token(&ptr, s2, NULL, sizeof(s2)); ) {
+ for (count = 0, ptr = sids_str;
+ next_token_talloc(frame,&ptr, &s2, NULL); ) {
DOM_SID tmpsid;
if (string_to_sid(&tmpsid, s2))
count++;
/* Now allocate space for them. */
if (count) {
*ppsids = TALLOC_ZERO_ARRAY(ctx, DOM_SID2, count);
- if (*ppsids == NULL)
+ if (*ppsids == NULL) {
+ TALLOC_FREE(frame);
return 0;
+ }
} else {
*ppsids = NULL;
}
sids = *ppsids;
- for (number = 0, ptr = sids_str; next_token(&ptr, s2, NULL, sizeof(s2)); ) {
+ for (number = 0, ptr = sids_str;
+ next_token_talloc(frame, &ptr, &s2, NULL); ) {
DOM_SID tmpsid;
if (string_to_sid(&tmpsid, s2)) {
/* count only valid sids */
number++;
}
}
+ TALLOC_FREE(frame);
}
return count;
Reads or writes an NET_ID_INFO_1 structure.
********************************************************************/
-static BOOL net_io_id_info1(const char *desc, NET_ID_INFO_1 *id, prs_struct *ps, int depth)
+static bool net_io_id_info1(const char *desc, NET_ID_INFO_1 *id, prs_struct *ps, int depth)
{
if (id == NULL)
return False;
Reads or writes an NET_ID_INFO_2 structure.
********************************************************************/
-static BOOL net_io_id_info2(const char *desc, NET_ID_INFO_2 *id, prs_struct *ps, int depth)
+static bool net_io_id_info2(const char *desc, NET_ID_INFO_2 *id, prs_struct *ps, int depth)
{
if (id == NULL)
return False;
sam->ctr = ctr;
}
+/*******************************************************************
+ Inits a DOM_SAM_INFO structure.
+********************************************************************/
+
+void init_sam_info_ex(DOM_SAM_INFO_EX *sam,
+ const char *logon_srv, const char *comp_name,
+ uint16 logon_level, NET_ID_INFO_CTR *ctr)
+{
+ DEBUG(5,("init_sam_info_ex: %d\n", __LINE__));
+
+ init_clnt_srv(&sam->client, logon_srv, comp_name);
+ sam->logon_level = logon_level;
+ sam->ctr = ctr;
+}
+
/*******************************************************************
Reads or writes a DOM_SAM_INFO structure.
********************************************************************/
-static BOOL net_io_id_info_ctr(const char *desc, NET_ID_INFO_CTR **pp_ctr, prs_struct *ps, int depth)
+static bool net_io_id_info_ctr(const char *desc, NET_ID_INFO_CTR **pp_ctr, prs_struct *ps, int depth)
{
NET_ID_INFO_CTR *ctr = *pp_ctr;
Reads or writes a DOM_SAM_INFO structure.
********************************************************************/
-static BOOL smb_io_sam_info(const char *desc, DOM_SAM_INFO *sam, prs_struct *ps, int depth)
+static bool smb_io_sam_info(const char *desc, DOM_SAM_INFO *sam, prs_struct *ps, int depth)
{
if (sam == NULL)
return False;
Reads or writes a DOM_SAM_INFO_EX structure.
********************************************************************/
-static BOOL smb_io_sam_info_ex(const char *desc, DOM_SAM_INFO_EX *sam, prs_struct *ps, int depth)
+static bool smb_io_sam_info_ex(const char *desc, DOM_SAM_INFO_EX *sam, prs_struct *ps, int depth)
{
if (sam == NULL)
return False;
Jacobsen at HP. JRA.
********************************************************************/
-BOOL net_io_user_info3(const char *desc, NET_USER_INFO_3 *usr, prs_struct *ps,
- int depth, uint16 validation_level, BOOL kerb_validation_level)
+bool net_io_user_info3(const char *desc, NET_USER_INFO_3 *usr, prs_struct *ps,
+ int depth, uint16 validation_level, bool kerb_validation_level)
{
unsigned int i;
}
if (UNMARSHALLING(ps)) {
- usr->gids = PRS_ALLOC_MEM(ps, DOM_GID, usr->num_groups);
- if (usr->gids == NULL)
- return False;
+ if (usr->num_groups) {
+ usr->gids = PRS_ALLOC_MEM(ps, DOM_GID, usr->num_groups);
+ if (usr->gids == NULL)
+ return False;
+ } else {
+ usr->gids = NULL;
+ }
}
for (i = 0; i < usr->num_groups; i++) {
return False;
if (UNMARSHALLING(ps)) {
- usr->other_sids = PRS_ALLOC_MEM(ps, DOM_SID2, usr->num_other_sids);
- usr->other_sids_attrib =
- PRS_ALLOC_MEM(ps, uint32, usr->num_other_sids);
-
+ if (usr->num_other_sids) {
+ usr->other_sids = PRS_ALLOC_MEM(ps, DOM_SID2, usr->num_other_sids);
+ usr->other_sids_attrib =
+ PRS_ALLOC_MEM(ps, uint32, usr->num_other_sids);
+ } else {
+ usr->other_sids = NULL;
+ usr->other_sids_attrib = NULL;
+ }
+
if ((num_other_sids != 0) &&
((usr->other_sids == NULL) ||
(usr->other_sids_attrib == NULL)))
Reads or writes a structure.
********************************************************************/
-BOOL net_io_q_sam_logon(const char *desc, NET_Q_SAM_LOGON *q_l, prs_struct *ps, int depth)
+bool net_io_q_sam_logon(const char *desc, NET_Q_SAM_LOGON *q_l, prs_struct *ps, int depth)
{
if (q_l == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL net_io_r_sam_logon(const char *desc, NET_R_SAM_LOGON *r_l, prs_struct *ps, int depth)
+bool net_io_r_sam_logon(const char *desc, NET_R_SAM_LOGON *r_l, prs_struct *ps, int depth)
{
if (r_l == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL net_io_q_sam_logon_ex(const char *desc, NET_Q_SAM_LOGON_EX *q_l, prs_struct *ps, int depth)
+bool net_io_q_sam_logon_ex(const char *desc, NET_Q_SAM_LOGON_EX *q_l, prs_struct *ps, int depth)
{
if (q_l == NULL)
return False;
if(!prs_uint16("validation_level", ps, depth, &q_l->validation_level))
return False;
+ if (!prs_align(ps))
+ return False;
+
if(!prs_uint32("flags ", ps, depth, &q_l->flags))
return False;
Reads or writes a structure.
********************************************************************/
-BOOL net_io_r_sam_logon_ex(const char *desc, NET_R_SAM_LOGON_EX *r_l, prs_struct *ps, int depth)
+bool net_io_r_sam_logon_ex(const char *desc, NET_R_SAM_LOGON_EX *r_l, prs_struct *ps, int depth)
{
if (r_l == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL net_io_q_sam_logoff(const char *desc, NET_Q_SAM_LOGOFF *q_l, prs_struct *ps, int depth)
+bool net_io_q_sam_logoff(const char *desc, NET_Q_SAM_LOGOFF *q_l, prs_struct *ps, int depth)
{
if (q_l == NULL)
return False;
Reads or writes a structure.
********************************************************************/
-BOOL net_io_r_sam_logoff(const char *desc, NET_R_SAM_LOGOFF *r_l, prs_struct *ps, int depth)
+bool net_io_r_sam_logoff(const char *desc, NET_R_SAM_LOGOFF *r_l, prs_struct *ps, int depth)
{
if (r_l == NULL)
return False;
/*******************************************************************
makes a NET_Q_SAM_SYNC structure.
********************************************************************/
-BOOL init_net_q_sam_sync(NET_Q_SAM_SYNC * q_s, const char *srv_name,
+bool init_net_q_sam_sync(NET_Q_SAM_SYNC * q_s, const char *srv_name,
const char *cli_name, DOM_CRED *cli_creds,
DOM_CRED *ret_creds, uint32 database_id,
uint32 next_rid)
/*******************************************************************
reads or writes a structure.
********************************************************************/
-BOOL net_io_q_sam_sync(const char *desc, NET_Q_SAM_SYNC * q_s, prs_struct *ps,
+bool net_io_q_sam_sync(const char *desc, NET_Q_SAM_SYNC * q_s, prs_struct *ps,
int depth)
{
prs_debug(ps, depth, desc, "net_io_q_sam_sync");
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL net_io_sam_delta_hdr(const char *desc, SAM_DELTA_HDR * delta,
+static bool net_io_sam_delta_hdr(const char *desc, SAM_DELTA_HDR * delta,
prs_struct *ps, int depth)
{
prs_debug(ps, depth, desc, "net_io_sam_delta_hdr");
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL net_io_sam_delta_mod_count(const char *desc, SAM_DELTA_MOD_COUNT *info,
+static bool net_io_sam_delta_mod_count(const char *desc, SAM_DELTA_MOD_COUNT *info,
prs_struct *ps, int depth)
{
prs_debug(ps, depth, desc, "net_io_sam_delta_stamp");
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL net_io_sam_domain_info(const char *desc, SAM_DOMAIN_INFO * info,
+static bool net_io_sam_domain_info(const char *desc, SAM_DOMAIN_INFO * info,
prs_struct *ps, int depth)
{
prs_debug(ps, depth, desc, "net_io_sam_domain_info");
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL net_io_sam_group_info(const char *desc, SAM_GROUP_INFO * info,
+static bool net_io_sam_group_info(const char *desc, SAM_GROUP_INFO * info,
prs_struct *ps, int depth)
{
prs_debug(ps, depth, desc, "net_io_sam_group_info");
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL net_io_sam_passwd_info(const char *desc, SAM_PWD * pwd,
+static bool net_io_sam_passwd_info(const char *desc, SAM_PWD * pwd,
prs_struct *ps, int depth)
{
prs_debug(ps, depth, desc, "net_io_sam_passwd_info");
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL net_io_sam_account_info(const char *desc, SAM_ACCOUNT_INFO *info,
+static bool net_io_sam_account_info(const char *desc, SAM_ACCOUNT_INFO *info,
prs_struct *ps, int depth)
{
BUFHDR2 hdr_priv_data;
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL net_io_sam_group_mem_info(const char *desc, SAM_GROUP_MEM_INFO * info,
+static bool net_io_sam_group_mem_info(const char *desc, SAM_GROUP_MEM_INFO * info,
prs_struct *ps, int depth)
{
uint32 i;
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL net_io_sam_alias_info(const char *desc, SAM_ALIAS_INFO * info,
+static bool net_io_sam_alias_info(const char *desc, SAM_ALIAS_INFO * info,
prs_struct *ps, int depth)
{
prs_debug(ps, depth, desc, "net_io_sam_alias_info");
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL net_io_sam_alias_mem_info(const char *desc, SAM_ALIAS_MEM_INFO * info,
+static bool net_io_sam_alias_mem_info(const char *desc, SAM_ALIAS_MEM_INFO * info,
prs_struct *ps, int depth)
{
uint32 i;
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL net_io_sam_policy_info(const char *desc, SAM_DELTA_POLICY *info,
+static bool net_io_sam_policy_info(const char *desc, SAM_DELTA_POLICY *info,
prs_struct *ps, int depth)
{
unsigned int i;
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL net_io_sam_trustdoms_info(const char *desc, SAM_DELTA_TRUSTDOMS *info,
+static bool net_io_sam_trustdoms_info(const char *desc, SAM_DELTA_TRUSTDOMS *info,
prs_struct *ps, int depth)
{
int i;
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL net_io_sam_secret_info(const char *desc, SAM_DELTA_SECRET *info,
+static bool net_io_sam_secret_info(const char *desc, SAM_DELTA_SECRET *info,
prs_struct *ps, int depth)
{
int i;
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL net_io_sam_privs_info(const char *desc, SAM_DELTA_PRIVS *info,
+static bool net_io_sam_privs_info(const char *desc, SAM_DELTA_PRIVS *info,
prs_struct *ps, int depth)
{
unsigned int i;
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static BOOL net_io_sam_delta_ctr(const char *desc,
+static bool net_io_sam_delta_ctr(const char *desc,
SAM_DELTA_CTR * delta, uint16 type,
prs_struct *ps, int depth)
{
/*******************************************************************
reads or writes a structure.
********************************************************************/
-BOOL net_io_r_sam_sync(const char *desc,
+bool net_io_r_sam_sync(const char *desc,
NET_R_SAM_SYNC * r_s, prs_struct *ps, int depth)
{
uint32 i;
/*******************************************************************
makes a NET_Q_SAM_DELTAS structure.
********************************************************************/
-BOOL init_net_q_sam_deltas(NET_Q_SAM_DELTAS *q_s, const char *srv_name,
+bool init_net_q_sam_deltas(NET_Q_SAM_DELTAS *q_s, const char *srv_name,
const char *cli_name, DOM_CRED *cli_creds,
uint32 database_id, uint64 dom_mod_count)
{
/*******************************************************************
reads or writes a structure.
********************************************************************/
-BOOL net_io_q_sam_deltas(const char *desc, NET_Q_SAM_DELTAS *q_s, prs_struct *ps,
+bool net_io_q_sam_deltas(const char *desc, NET_Q_SAM_DELTAS *q_s, prs_struct *ps,
int depth)
{
prs_debug(ps, depth, desc, "net_io_q_sam_deltas");
/*******************************************************************
reads or writes a structure.
********************************************************************/
-BOOL net_io_r_sam_deltas(const char *desc,
+bool net_io_r_sam_deltas(const char *desc,
NET_R_SAM_DELTAS *r_s, prs_struct *ps, int depth)
{
unsigned int i;
r_t->flags = flags;
}
+/*******************************************************************
+ Inits a NET_Q_DSR_GETDCNAMEEX structure.
+********************************************************************/
+
+void init_net_q_dsr_getdcnameex(NET_Q_DSR_GETDCNAMEEX *r_t, const char *server_unc,
+ const char *domain_name,
+ struct GUID *domain_guid,
+ const char *site_name,
+ uint32_t flags)
+{
+ DEBUG(5, ("init_net_q_dsr_getdcnameex\n"));
+
+ r_t->ptr_server_unc = (server_unc != NULL);
+ init_unistr2(&r_t->uni_server_unc, server_unc, UNI_STR_TERMINATE);
+
+ r_t->ptr_domain_name = (domain_name != NULL);
+ init_unistr2(&r_t->uni_domain_name, domain_name, UNI_STR_TERMINATE);
+
+ r_t->ptr_domain_guid = (domain_guid != NULL);
+ r_t->domain_guid = domain_guid;
+
+ r_t->ptr_site_name = (site_name != NULL);
+ init_unistr2(&r_t->uni_site_name, site_name, UNI_STR_TERMINATE);
+
+ r_t->flags = flags;
+}
+
+/*******************************************************************
+ Inits a NET_Q_DSR_GETDCNAMEEX2 structure.
+********************************************************************/
+
+void init_net_q_dsr_getdcnameex2(NET_Q_DSR_GETDCNAMEEX2 *r_t, const char *server_unc,
+ const char *domain_name,
+ const char *client_account,
+ uint32 mask,
+ struct GUID *domain_guid,
+ const char *site_name,
+ uint32_t flags)
+{
+ DEBUG(5, ("init_net_q_dsr_getdcnameex2\n"));
+
+ r_t->ptr_server_unc = (server_unc != NULL);
+ init_unistr2(&r_t->uni_server_unc, server_unc, UNI_STR_TERMINATE);
+
+ r_t->ptr_client_account = (client_account != NULL);
+ init_unistr2(&r_t->uni_client_account, client_account, UNI_STR_TERMINATE);
+
+ r_t->mask = mask;
+
+ r_t->ptr_domain_name = (domain_name != NULL);
+ init_unistr2(&r_t->uni_domain_name, domain_name, UNI_STR_TERMINATE);
+
+ r_t->ptr_domain_guid = (domain_guid != NULL);
+ r_t->domain_guid = domain_guid;
+
+ r_t->ptr_site_name = (site_name != NULL);
+ init_unistr2(&r_t->uni_site_name, site_name, UNI_STR_TERMINATE);
+
+ r_t->flags = flags;
+}
+
/*******************************************************************
Reads or writes an NET_Q_DSR_GETDCNAME structure.
********************************************************************/
-BOOL net_io_q_dsr_getdcname(const char *desc, NET_Q_DSR_GETDCNAME *r_t,
+bool net_io_q_dsr_getdcname(const char *desc, NET_Q_DSR_GETDCNAME *r_t,
prs_struct *ps, int depth)
{
if (r_t == NULL)
return True;
}
+/*******************************************************************
+ Reads or writes an NET_Q_DSR_GETDCNAMEEX structure.
+********************************************************************/
+
+bool net_io_q_dsr_getdcnameex(const char *desc, NET_Q_DSR_GETDCNAMEEX *r_t,
+ prs_struct *ps, int depth)
+{
+ if (r_t == NULL)
+ return False;
+
+ prs_debug(ps, depth, desc, "net_io_q_dsr_getdcnameex");
+ depth++;
+
+ if (!prs_uint32("ptr_server_unc", ps, depth, &r_t->ptr_server_unc))
+ return False;
+
+ if (!smb_io_unistr2("server_unc", &r_t->uni_server_unc,
+ r_t->ptr_server_unc, ps, depth))
+ return False;
+
+ if (!prs_align(ps))
+ return False;
+
+ if (!prs_uint32("ptr_domain_name", ps, depth, &r_t->ptr_domain_name))
+ return False;
+
+ if (!smb_io_unistr2("domain_name", &r_t->uni_domain_name,
+ r_t->ptr_domain_name, ps, depth))
+ return False;
+
+ if (!prs_align(ps))
+ return False;
+
+ if (!prs_uint32("ptr_domain_guid", ps, depth, &r_t->ptr_domain_guid))
+ return False;
+
+ if (UNMARSHALLING(ps) && (r_t->ptr_domain_guid)) {
+ r_t->domain_guid = PRS_ALLOC_MEM(ps, struct GUID, 1);
+ if (r_t->domain_guid == NULL)
+ return False;
+ }
+
+ if ((r_t->ptr_domain_guid) &&
+ (!smb_io_uuid("domain_guid", r_t->domain_guid, ps, depth)))
+ return False;
+
+ if (!prs_align(ps))
+ return False;
+
+ if (!prs_uint32("ptr_site_name", ps, depth, &r_t->ptr_site_name))
+ return False;
+
+ if (!smb_io_unistr2("site_name", &r_t->uni_site_name,
+ r_t->ptr_site_name, ps, depth))
+ return False;
+
+ if (!prs_align(ps))
+ return False;
+
+ if (!prs_uint32("flags", ps, depth, &r_t->flags))
+ return False;
+
+ return True;
+}
+
+/*******************************************************************
+ Reads or writes an NET_Q_DSR_GETDCNAMEEX2 structure.
+********************************************************************/
+
+bool net_io_q_dsr_getdcnameex2(const char *desc, NET_Q_DSR_GETDCNAMEEX2 *r_t,
+ prs_struct *ps, int depth)
+{
+ if (r_t == NULL)
+ return False;
+
+ prs_debug(ps, depth, desc, "net_io_q_dsr_getdcnameex2");
+ depth++;
+
+ if (!prs_uint32("ptr_server_unc", ps, depth, &r_t->ptr_server_unc))
+ return False;
+
+ if (!smb_io_unistr2("server_unc", &r_t->uni_server_unc,
+ r_t->ptr_server_unc, ps, depth))
+ return False;
+
+ if (!prs_align(ps))
+ return False;
+
+ if (!prs_uint32("ptr_client_account", ps, depth, &r_t->ptr_client_account))
+ return False;
+
+ if (!smb_io_unistr2("client_account", &r_t->uni_client_account,
+ r_t->ptr_client_account, ps, depth))
+ return False;
+
+ if (!prs_align(ps))
+ return False;
+
+ if (!prs_uint32("mask", ps, depth, &r_t->mask))
+ return False;
+
+ if (!prs_align(ps))
+ return False;
+
+ if (!prs_uint32("ptr_domain_name", ps, depth, &r_t->ptr_domain_name))
+ return False;
+
+ if (!smb_io_unistr2("domain_name", &r_t->uni_domain_name,
+ r_t->ptr_domain_name, ps, depth))
+ return False;
+
+ if (!prs_align(ps))
+ return False;
+
+ if (!prs_uint32("ptr_domain_guid", ps, depth, &r_t->ptr_domain_guid))
+ return False;
+
+ if (UNMARSHALLING(ps) && (r_t->ptr_domain_guid)) {
+ r_t->domain_guid = PRS_ALLOC_MEM(ps, struct GUID, 1);
+ if (r_t->domain_guid == NULL)
+ return False;
+ }
+
+ if ((r_t->ptr_domain_guid) &&
+ (!smb_io_uuid("domain_guid", r_t->domain_guid, ps, depth)))
+ return False;
+
+ if (!prs_align(ps))
+ return False;
+
+ if (!prs_uint32("ptr_site_name", ps, depth, &r_t->ptr_site_name))
+ return False;
+
+ if (!smb_io_unistr2("site_name", &r_t->uni_site_name,
+ r_t->ptr_site_name, ps, depth))
+ return False;
+
+ if (!prs_align(ps))
+ return False;
+
+ if (!prs_uint32("flags", ps, depth, &r_t->flags))
+ return False;
+
+ return True;
+}
+
+
+
/*******************************************************************
Inits a NET_R_DSR_GETDCNAME structure.
********************************************************************/
Reads or writes an NET_R_DSR_GETDCNAME structure.
********************************************************************/
-BOOL net_io_r_dsr_getdcname(const char *desc, NET_R_DSR_GETDCNAME *r_t,
+bool net_io_r_dsr_getdcname(const char *desc, NET_R_DSR_GETDCNAME *r_t,
prs_struct *ps, int depth)
{
uint32 info_ptr = 1;
Reads or writes an NET_Q_DSR_GETSITENAME structure.
********************************************************************/
-BOOL net_io_q_dsr_getsitename(const char *desc, NET_Q_DSR_GETSITENAME *r_t,
+bool net_io_q_dsr_getsitename(const char *desc, NET_Q_DSR_GETSITENAME *r_t,
prs_struct *ps, int depth)
{
if (r_t == NULL)
Reads or writes an NET_R_DSR_GETSITENAME structure.
********************************************************************/
-BOOL net_io_r_dsr_getsitename(const char *desc, NET_R_DSR_GETSITENAME *r_t,
+bool net_io_r_dsr_getsitename(const char *desc, NET_R_DSR_GETSITENAME *r_t,
prs_struct *ps, int depth)
{
if (r_t == NULL)