1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

r7577: switching to macro for IS_DC

This commit is contained in:
Gerald Carter 2005-06-14 18:31:06 +00:00 committed by Gerald (Jerry) Carter
parent 11902e503e
commit e6df9a7ac7

View File

@ -80,23 +80,12 @@ static DOM_SID *pdb_generate_sam_sid(void)
{
DOM_SID domain_sid;
char *fname = NULL;
BOOL is_dc = False;
DOM_SID *sam_sid;
if(!(sam_sid=SMB_MALLOC_P(DOM_SID)))
return NULL;
switch (lp_server_role()) {
case ROLE_DOMAIN_PDC:
case ROLE_DOMAIN_BDC:
is_dc = True;
break;
default:
is_dc = False;
break;
}
if (is_dc) {
if ( IS_DC ) {
if (secrets_fetch_domain_sid(lp_workgroup(), &domain_sid)) {
sid_copy(sam_sid, &domain_sid);
return sam_sid;
@ -106,7 +95,7 @@ static DOM_SID *pdb_generate_sam_sid(void)
if (secrets_fetch_domain_sid(global_myname(), sam_sid)) {
/* We got our sid. If not a pdc/bdc, we're done. */
if (!is_dc)
if ( !IS_DC )
return sam_sid;
if (!secrets_fetch_domain_sid(lp_workgroup(), &domain_sid)) {
@ -150,7 +139,7 @@ static DOM_SID *pdb_generate_sam_sid(void)
return NULL;
}
unlink(fname);
if (is_dc) {
if ( !IS_DC ) {
if (!secrets_store_domain_sid(lp_workgroup(), sam_sid)) {
DEBUG(0,("pdb_generate_sam_sid: Failed to store domain SID from file.\n"));
SAFE_FREE(fname);
@ -175,7 +164,7 @@ static DOM_SID *pdb_generate_sam_sid(void)
SAFE_FREE(sam_sid);
return NULL;
}
if (is_dc) {
if ( IS_DC ) {
if (!secrets_store_domain_sid(lp_workgroup(), sam_sid)) {
DEBUG(0,("pdb_generate_sam_sid: Failed to store generated domain SID.\n"));
SAFE_FREE(sam_sid);