inits a structure.
********************************************************************/
-void init_unk_info6(SAM_UNK_INFO_6 * u_6)
+void init_unk_info6(SAM_UNK_INFO_6 * u_6, const char *server)
{
- u_6->unknown_0 = 0x00000000;
- u_6->ptr_0 = 1;
- memset(u_6->padding, 0, sizeof(u_6->padding)); /* 12 bytes zeros */
+ init_unistr2(&u_6->uni_server, server, UNI_FLAGS_NONE);
+ init_uni_hdr(&u_6->hdr_server, &u_6->uni_server);
}
/*******************************************************************
prs_debug(ps, depth, desc, "sam_io_unk_info6");
depth++;
- if(!prs_uint32("unknown_0", ps, depth, &u_6->unknown_0)) /* 0x0000 0000 */
+ if(!smb_io_unihdr("hdr_server", &u_6->hdr_server, ps, depth))
return False;
- if(!prs_uint32("ptr_0", ps, depth, &u_6->ptr_0)) /* pointer to unknown structure */
+
+ if(!smb_io_unistr2("uni_server", &u_6->uni_server, u_6->hdr_server.buffer, ps, depth))
+ return False;
+
+ return True;
+}
+
+/*******************************************************************
+inits a structure.
+********************************************************************/
+
+void init_unk_info4(SAM_UNK_INFO_4 * u_4,const char *comment)
+{
+ init_unistr2(&u_4->uni_comment, comment, UNI_FLAGS_NONE);
+ init_uni_hdr(&u_4->hdr_comment, &u_4->uni_comment);
+}
+
+/*******************************************************************
+reads or writes a structure.
+********************************************************************/
+
+static BOOL sam_io_unk_info4(const char *desc, SAM_UNK_INFO_4 * u_4,
+ prs_struct *ps, int depth)
+{
+ if (u_4 == NULL)
+ return False;
+
+ prs_debug(ps, depth, desc, "sam_io_unk_info4");
+ depth++;
+
+ if(!smb_io_unihdr("hdr_comment", &u_4->hdr_comment, ps, depth))
return False;
- if(!prs_uint8s(False, "padding", ps, depth, u_6->padding, sizeof(u_6->padding))) /* 12 bytes zeros */
+
+ if(!smb_io_unistr2("uni_comment", &u_4->uni_comment, u_4->hdr_comment.buffer, ps, depth))
return False;
return True;
return True;
}
+/*******************************************************************
+inits a structure.
+********************************************************************/
+
+void init_unk_info9(SAM_UNK_INFO_9 * u_9, uint32 unknown)
+{
+ u_9->unknown = unknown;
+}
+
+/*******************************************************************
+reads or writes a structure.
+********************************************************************/
+
+static BOOL sam_io_unk_info9(const char *desc, SAM_UNK_INFO_9 * u_9,
+ prs_struct *ps, int depth)
+{
+ if (u_9 == NULL)
+ return False;
+
+ prs_debug(ps, depth, desc, "sam_io_unk_info9");
+ depth++;
+
+ if (!prs_uint32("unknown", ps, depth, &u_9->unknown))
+ return False;
+
+ return True;
+}
/*******************************************************************
inits a structure.
inits a structure.
********************************************************************/
+void init_unk_info13(SAM_UNK_INFO_13 * u_13, uint32 seq_num)
+{
+ unix_to_nt_time(&u_13->domain_create_time, 0);
+ u_13->seq_num.low = seq_num;
+ u_13->seq_num.high = 0x0000;
+ u_13->unknown1 = 0;
+ u_13->unknown2 = 0;
+}
+
+/*******************************************************************
+reads or writes a structure.
+********************************************************************/
+
+static BOOL sam_io_unk_info13(const char *desc, SAM_UNK_INFO_13 * u_13,
+ prs_struct *ps, int depth)
+{
+ if (u_13 == NULL)
+ return False;
+
+ prs_debug(ps, depth, desc, "sam_io_unk_info13");
+ depth++;
+
+ if (!prs_uint64("seq_num", ps, depth, &u_13->seq_num))
+ return False;
+
+ if(!smb_io_time("domain_create_time", &u_13->domain_create_time, ps, depth))
+ return False;
+
+ if (!prs_uint32("unknown1", ps, depth, &u_13->unknown1))
+ return False;
+ if (!prs_uint32("unknown2", ps, depth, &u_13->unknown2))
+ return False;
+
+
+
+ return True;
+}
+
+/*******************************************************************
+inits a structure.
+********************************************************************/
+
void init_unk_info2(SAM_UNK_INFO_2 * u_2,
const char *comment, const char *domain, const char *server,
uint32 seq_num, uint32 num_users, uint32 num_groups, uint32 num_alias, NTTIME nt_logout, uint32 server_role)
return False;
switch (r_u->switch_value) {
+ case 0x0d:
+ if(!sam_io_unk_info13("unk_inf13", &r_u->ctr->info.inf13, ps, depth))
+ return False;
+ break;
case 0x0c:
if(!sam_io_unk_info12("unk_inf12", &r_u->ctr->info.inf12, ps, depth))
return False;
break;
+ case 0x09:
+ if(!sam_io_unk_info9("unk_inf9",&r_u->ctr->info.inf9, ps,depth))
+ return False;
+ break;
case 0x08:
if(!sam_io_unk_info8("unk_inf8",&r_u->ctr->info.inf8, ps,depth))
return False;
if(!sam_io_unk_info5("unk_inf5",&r_u->ctr->info.inf5, ps,depth))
return False;
break;
+ case 0x04:
+ if(!sam_io_unk_info4("unk_inf4",&r_u->ctr->info.inf4, ps,depth))
+ return False;
+ break;
case 0x03:
if(!sam_io_unk_info3("unk_inf3",&r_u->ctr->info.inf3, ps,depth))
return False;
init_unk_info5(&ctr->info.inf5, get_global_sam_name());
break;
case 0x06:
- init_unk_info6(&ctr->info.inf6);
+ /* NT returns its own name when a PDC. win2k and later
+ * only the name of the PDC if itself is a BDC (samba4
+ * idl) */
+ init_unk_info6(&ctr->info.inf6, global_myname());
break;
case 0x07:
server_role = ROLE_DOMAIN_PDC;
********************************************************************/
NTSTATUS _samr_query_domain_info2(pipes_struct *p,
- SAMR_Q_QUERY_DOMAIN_INFO2 *q_u,
- SAMR_R_QUERY_DOMAIN_INFO2 *r_u)
+ SAMR_Q_QUERY_DOMAIN_INFO2 *q_u,
+ SAMR_R_QUERY_DOMAIN_INFO2 *r_u)
{
struct samr_info *info = NULL;
SAM_UNK_CTR *ctr;
init_unk_info5(&ctr->info.inf5, get_global_sam_name());
break;
case 0x06:
- init_unk_info6(&ctr->info.inf6);
+ /* NT returns its own name when a PDC. win2k and later
+ * only the name of the PDC if itself is a BDC (samba4
+ * idl) */
+ init_unk_info6(&ctr->info.inf6, global_myname());
break;
case 0x07:
server_role = ROLE_DOMAIN_PDC;
}
/*******************************************************************
- _samr_
+ _samr_set_dom_info
********************************************************************/
NTSTATUS _samr_set_dom_info(pipes_struct *p, SAMR_Q_SET_DOMAIN_INFO *q_u, SAMR_R_SET_DOMAIN_INFO *r_u)
printf("Unknown 6:\t0x%x\n", info2->unknown_6);
}
+static void display_sam_unk_info_3(SAM_UNK_INFO_3 *info3)
+{
+ printf("Force Logoff:\t%d\n", (int)nt_time_to_unix_abs(&info3->logout));
+}
+
+static void display_sam_unk_info_4(SAM_UNK_INFO_4 *info4)
+{
+ fstring name;
+
+ unistr2_to_ascii(name, &info4->uni_comment, sizeof(name) - 1);
+ printf("Comment:\t%s\n", name);
+}
+
+static void display_sam_unk_info_5(SAM_UNK_INFO_5 *info5)
+{
+ fstring name;
+
+ unistr2_to_ascii(name, &info5->uni_domain, sizeof(name) - 1);
+ printf("Domain:\t\t%s\n", name);
+}
+
+static void display_sam_unk_info_6(SAM_UNK_INFO_6 *info6)
+{
+ fstring name;
+
+ unistr2_to_ascii(name, &info6->uni_server, sizeof(name) - 1);
+ printf("Server:\t\t%s\n", name);
+}
+
static void display_sam_unk_info_7(SAM_UNK_INFO_7 *info7)
{
printf("Server Role:\t%s\n", server_role_str(info7->server_role));
printf("Sequence No:\t%d\n", info8->seq_num.low);
printf("Domain Create Time:\t%s\n",
http_timestring(nt_time_to_unix(&info8->domain_create_time)));
+}
+static void display_sam_unk_info_9(SAM_UNK_INFO_9 *info9)
+{
+ printf("unknown:\t%d (0x%08x)\n", info9->unknown, info9->unknown);
}
static void display_sam_unk_info_12(SAM_UNK_INFO_12 *info12)
printf("Lockout after bad attempts: %d\n", info12->bad_attempt_lockout);
}
+static void display_sam_unk_info_13(SAM_UNK_INFO_13 *info13)
+{
+ printf("Sequence No:\t%d\n", info13->seq_num.low);
+ printf("Domain Create Time:\t%s\n",
+ http_timestring(nt_time_to_unix(&info13->domain_create_time)));
+ printf("Unknown1:\t%d\n", info13->unknown1);
+ printf("Unknown2:\t%d\n", info13->unknown2);
+
+}
+
static void display_sam_info_1(SAM_ENTRY1 *e1, SAM_STR1 *s1)
{
fstring tmp;
case 2:
display_sam_unk_info_2(&ctr.info.inf2);
break;
+ case 3:
+ display_sam_unk_info_3(&ctr.info.inf3);
+ break;
+ case 4:
+ display_sam_unk_info_4(&ctr.info.inf4);
+ break;
+ case 5:
+ display_sam_unk_info_5(&ctr.info.inf5);
+ break;
+ case 6:
+ display_sam_unk_info_6(&ctr.info.inf6);
+ break;
case 7:
display_sam_unk_info_7(&ctr.info.inf7);
break;
case 8:
display_sam_unk_info_8(&ctr.info.inf8);
break;
+ case 9:
+ display_sam_unk_info_9(&ctr.info.inf9);
+ break;
case 12:
display_sam_unk_info_12(&ctr.info.inf12);
break;
+ case 13:
+ display_sam_unk_info_13(&ctr.info.inf13);
+ break;
+
default:
printf("cannot display domain info for switch value %d\n",
switch_level);