summaryrefslogtreecommitdiff
path: root/source3/passdb/machine_sid.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-04-21 14:09:03 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-04-21 14:09:03 +0000
commitf071020f5e49837154581c97c5af5f84d0e2de89 (patch)
tree14c4f4c08cc935145926000a886f8dd718c66e93 /source3/passdb/machine_sid.c
parent06c99d15e217e265d51778268d5b859dff3c478c (diff)
downloadsamba-f071020f5e49837154581c97c5af5f84d0e2de89.tar.gz
samba-f071020f5e49837154581c97c5af5f84d0e2de89.tar.bz2
samba-f071020f5e49837154581c97c5af5f84d0e2de89.zip
Merge from HEAD - save the type of channel used to contact the DC.
This allows us to join as a BDC, without appearing on the network as one until we have the database replicated, and the admin changes the configuration. This also change the SID retreval order from secrets.tdb, so we no longer require a 'net rpc getsid' - the sid fetch during the domain join is sufficient. Also minor fixes to 'net'. Andrew Bartlett (This used to be commit 876e00fd112e4aaf7519eec27f382eb99ec7562a)
Diffstat (limited to 'source3/passdb/machine_sid.c')
-rw-r--r--source3/passdb/machine_sid.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source3/passdb/machine_sid.c b/source3/passdb/machine_sid.c
index 071af50877..a578ecc711 100644
--- a/source3/passdb/machine_sid.c
+++ b/source3/passdb/machine_sid.c
@@ -78,6 +78,7 @@ static void generate_random_sid(DOM_SID *sid)
static BOOL pdb_generate_sam_sid(void)
{
+ DOM_SID domain_sid;
char *fname = NULL;
BOOL is_dc = False;
@@ -97,8 +98,14 @@ static BOOL pdb_generate_sam_sid(void)
break;
}
+ if (is_dc) {
+ if (secrets_fetch_domain_sid(lp_workgroup(), &domain_sid)) {
+ sid_copy(global_sam_sid, &domain_sid);
+ return True;
+ }
+ }
+
if (secrets_fetch_domain_sid(global_myname(), global_sam_sid)) {
- DOM_SID domain_sid;
/* We got our sid. If not a pdc/bdc, we're done. */
if (!is_dc)
@@ -117,11 +124,11 @@ static BOOL pdb_generate_sam_sid(void)
if (!sid_equal(&domain_sid, global_sam_sid)) {
- /* Domain name sid doesn't match global sam sid. Re-store global sam sid as domain sid. */
+ /* Domain name sid doesn't match global sam sid. Re-store domain sid as 'local' sid. */
DEBUG(0,("pdb_generate_sam_sid: Mismatched SIDs as a pdc/bdc.\n"));
- if (!secrets_store_domain_sid(lp_workgroup(), global_sam_sid)) {
- DEBUG(0,("pdb_generate_sam_sid: Can't re-store domain SID as a pdc/bdc.\n"));
+ if (!secrets_store_domain_sid(global_myname(), &domain_sid)) {
+ DEBUG(0,("pdb_generate_sam_sid: Can't re-store domain SID for local sid as PDC/BDC.\n"));
return False;
}
return True;