summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2004-12-22 23:50:31 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:44 -0500
commit8222f958d15256a62712710c9c9a159106746d8b (patch)
tree7764b453eb4973fa2d541906a85548e4483e9ced /source3
parent44bac2bf7b8537a7cd414a883b5c89042c6ad179 (diff)
downloadsamba-8222f958d15256a62712710c9c9a159106746d8b.tar.gz
samba-8222f958d15256a62712710c9c9a159106746d8b.tar.bz2
samba-8222f958d15256a62712710c9c9a159106746d8b.zip
r4336: Apply some other samba4 SAMR idl that is just too obvious. Don't hard
set the value "forcibly disconnect remote users from server when logon hours expire" to "no", instead take the value from our account-policy storage. Guenther (This used to be commit e3bd2a22a5cebc4adf6910d3ec31bc6fada8cd35)
Diffstat (limited to 'source3')
-rw-r--r--source3/include/rpc_samr.h3
-rw-r--r--source3/rpc_parse/parse_samr.c10
-rw-r--r--source3/rpc_server/srv_samr_nt.c16
-rw-r--r--source3/rpcclient/cmd_samr.c6
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);