summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2005-02-07 14:14:44 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:34 -0500
commite98f56373bca0efc200bc3a4263477e1790a746b (patch)
treeb90a2b814be5fffe100b7660f5493e5323836925 /source3/rpc_server
parent5a595ccff88c59af42b7ac23ac5cf75e33104137 (diff)
downloadsamba-e98f56373bca0efc200bc3a4263477e1790a746b.tar.gz
samba-e98f56373bca0efc200bc3a4263477e1790a746b.tar.bz2
samba-e98f56373bca0efc200bc3a4263477e1790a746b.zip
r5262: Fix server_role in the samr_query_dom_info calls. When we are a BDC we
should not say we are a PDC. Guenther (This used to be commit 6cdf3b97de2c28ac92f972621b0ce04c1c80cea5)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_samr_nt.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index 1d4569e39f..4e7d239b2c 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -2072,6 +2072,7 @@ NTSTATUS _samr_query_dom_info(pipes_struct *p, SAMR_Q_QUERY_DOMAIN_INFO *q_u, SA
NTTIME nt_logout;
uint32 account_policy_temp;
+ uint32 server_role;
uint32 num_users=0, num_groups=0, num_aliases=0;
@@ -2136,9 +2137,13 @@ NTSTATUS _samr_query_dom_info(pipes_struct *p, SAMR_Q_QUERY_DOMAIN_INFO *q_u, SA
unix_to_nt_time_abs(&nt_logout, u_logout);
+ server_role = ROLE_DOMAIN_PDC;
+ if (lp_server_role() == ROLE_DOMAIN_BDC)
+ server_role = ROLE_DOMAIN_BDC;
+
/* 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, nt_logout);
+ init_unk_info2(&ctr->info.inf2, lp_serverstring(), lp_workgroup(), global_myname(), time(NULL),
+ num_users, num_groups, num_aliases, nt_logout, server_role);
break;
case 0x03:
pdb_get_account_policy(AP_TIME_TO_LOGOUT, (unsigned int *)&u_logout);
@@ -2153,7 +2158,11 @@ NTSTATUS _samr_query_dom_info(pipes_struct *p, SAMR_Q_QUERY_DOMAIN_INFO *q_u, SA
init_unk_info6(&ctr->info.inf6);
break;
case 0x07:
- init_unk_info7(&ctr->info.inf7);
+ server_role = ROLE_DOMAIN_PDC;
+ if (lp_server_role() == ROLE_DOMAIN_BDC)
+ server_role = ROLE_DOMAIN_BDC;
+
+ init_unk_info7(&ctr->info.inf7, server_role);
break;
case 0x08:
init_unk_info8(&ctr->info.inf8, (uint32) time(NULL));
@@ -4546,6 +4555,7 @@ NTSTATUS _samr_unknown_2e(pipes_struct *p, SAMR_Q_UNKNOWN_2E *q_u, SAMR_R_UNKNOW
uint32 num_users=0, num_groups=0, num_aliases=0;
uint32 account_policy_temp;
+ uint32 server_role;
if ((ctr = TALLOC_ZERO_P(p->mem_ctx, SAM_UNK_CTR)) == NULL)
return NT_STATUS_NO_MEMORY;
@@ -4607,9 +4617,13 @@ NTSTATUS _samr_unknown_2e(pipes_struct *p, SAMR_Q_UNKNOWN_2E *q_u, SAMR_R_UNKNOW
unix_to_nt_time_abs(&nt_logout, u_logout);
+ server_role = ROLE_DOMAIN_PDC;
+ if (lp_server_role() == ROLE_DOMAIN_BDC)
+ server_role = ROLE_DOMAIN_BDC;
+
/* 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, nt_logout);
+ init_unk_info2(&ctr->info.inf2, lp_serverstring(), lp_workgroup(), global_myname(), time(NULL),
+ num_users, num_groups, num_aliases, nt_logout, server_role);
break;
case 0x03:
pdb_get_account_policy(AP_TIME_TO_LOGOUT, &account_policy_temp);
@@ -4626,7 +4640,10 @@ NTSTATUS _samr_unknown_2e(pipes_struct *p, SAMR_Q_UNKNOWN_2E *q_u, SAMR_R_UNKNOW
init_unk_info6(&ctr->info.inf6);
break;
case 0x07:
- init_unk_info7(&ctr->info.inf7);
+ server_role = ROLE_DOMAIN_PDC;
+ if (lp_server_role() == ROLE_DOMAIN_BDC)
+ server_role = ROLE_DOMAIN_BDC;
+ init_unk_info7(&ctr->info.inf7, server_role);
break;
case 0x08:
init_unk_info8(&ctr->info.inf8, (uint32) time(NULL));