diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/rpc_samr.h | 3 | ||||
-rw-r--r-- | source3/rpc_parse/parse_samr.c | 10 | ||||
-rw-r--r-- | source3/rpc_server/srv_samr_nt.c | 16 | ||||
-rw-r--r-- | source3/rpcclient/cmd_samr.c | 6 |
4 files changed, 21 insertions, 14 deletions
diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h index e3fbebaa77..9945f674c8 100644 --- a/source3/include/rpc_samr.h +++ b/source3/include/rpc_samr.h @@ -561,8 +561,7 @@ typedef struct sam_unknown_info_5_inf typedef struct sam_unknown_info_2_inf { - uint32 unknown_0; /* 0x0000 0000 */ - uint32 unknown_1; /* 0x8000 0000 */ + NTTIME logout; /* whether users are forcibly disconnected when logon hours expire */ UNIHDR hdr_comment; /* comment according to samba4 idl */ UNIHDR hdr_domain; /* domain name unicode header */ UNIHDR hdr_server; /* server name unicode header */ diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c index 5b211f8349..8d5fee68e0 100644 --- a/source3/rpc_parse/parse_samr.c +++ b/source3/rpc_parse/parse_samr.c @@ -697,10 +697,10 @@ 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) + uint32 seq_num, uint32 num_users, uint32 num_groups, uint32 num_alias, NTTIME nt_logout) { - u_2->unknown_0 = 0x00000000; - u_2->unknown_1 = 0x80000000; + u_2->logout.low = nt_logout.low; + u_2->logout.high = nt_logout.high; u_2->seq_num.low = seq_num; u_2->seq_num.high = 0x00000000; @@ -736,9 +736,7 @@ static BOOL sam_io_unk_info2(const char *desc, SAM_UNK_INFO_2 * u_2, prs_debug(ps, depth, desc, "sam_io_unk_info2"); depth++; - if(!prs_uint32("unknown_0", ps, depth, &u_2->unknown_0)) /* 0x0000 0000 */ - return False; - if(!prs_uint32("unknown_1", ps, depth, &u_2->unknown_1)) /* 0x8000 0000 */ + if(!smb_io_time("logout", &u_2->logout, ps, depth)) return False; if(!smb_io_unihdr("hdr_comment", &u_2->hdr_comment, ps, depth)) return False; diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index 5d7cd84390..8219e689f0 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -2113,10 +2113,15 @@ NTSTATUS _samr_query_dom_info(pipes_struct *p, SAMR_Q_QUERY_DOMAIN_INFO *q_u, SA } num_groups=info->disp_info.num_group_account; free_samr_db(info); - + + account_policy_get(AP_TIME_TO_LOGOUT, &account_policy_temp); + u_logout = account_policy_temp; + + unix_to_nt_time_abs(&nt_logout, u_logout); + /* The time call below is to get a sequence number for the sam. FIXME !!! JRA. */ init_unk_info2(&ctr->info.inf2, "", lp_workgroup(), global_myname(), (uint32) time(NULL), - num_users, num_groups, num_aliases); + num_users, num_groups, num_aliases, nt_logout); break; case 0x03: account_policy_get(AP_TIME_TO_LOGOUT, (unsigned int *)&u_logout); @@ -4360,9 +4365,14 @@ NTSTATUS _samr_unknown_2e(pipes_struct *p, SAMR_Q_UNKNOWN_2E *q_u, SAMR_R_UNKNOW num_groups=info->disp_info.num_group_account; free_samr_db(info); + account_policy_get(AP_TIME_TO_LOGOUT, &account_policy_temp); + u_logout = account_policy_temp; + + unix_to_nt_time_abs(&nt_logout, u_logout); + /* The time call below is to get a sequence number for the sam. FIXME !!! JRA. */ init_unk_info2(&ctr->info.inf2, "", lp_workgroup(), global_myname(), (uint32) time(NULL), - num_users, num_groups, num_aliases); + num_users, num_groups, num_aliases, nt_logout); break; case 0x03: account_policy_get(AP_TIME_TO_LOGOUT, &account_policy_temp); diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c index 2a282680a8..91296a4967 100644 --- a/source3/rpcclient/cmd_samr.c +++ b/source3/rpcclient/cmd_samr.c @@ -161,9 +161,9 @@ static void display_sam_unk_info_2(SAM_UNK_INFO_2 *info2) printf("Total Aliases:\t%d\n", info2->num_local_grps); printf("Sequence No:\t%d\n", info2->seq_num.low); - - printf("Unknown 0:\t0x%x\n", info2->unknown_0); - printf("Unknown 1:\t0x%x\n", info2->unknown_1); + + printf("Force Logoff:\t%d\n", (int)nt_time_to_unix_abs(&info2->logout)); + printf("Unknown 4:\t0x%x\n", info2->unknown_4); printf("Unknown 5:\t0x%x\n", info2->unknown_5); printf("Unknown 6:\t0x%x\n", info2->unknown_6); |