1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s4-loadparm: fix the FLAG_DEFAULT settings on specially handled parameters

parameters with special handlers also need to clear the FLAG_DEFAULT
flag when set

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Nov 11 03:39:23 UTC 2010 on sn-devel-104
This commit is contained in:
Andrew Tridgell 2010-11-11 13:56:44 +11:00
parent 21fe96e8f9
commit ee50bdd42f

View File

@ -1627,9 +1627,13 @@ static bool set_variable(TALLOC_CTX *mem_ctx, int parmnum, void *parm_ptr,
int i;
/* if it is a special case then go ahead */
if (parm_table[parmnum].special) {
parm_table[parmnum].special(lp_ctx, pszParmValue,
(char **)parm_ptr);
return true;
bool ret;
ret = parm_table[parmnum].special(lp_ctx, pszParmValue,
(char **)parm_ptr);
if (!ret) {
return false;
}
goto mark_non_default;
}
/* now switch on the type of variable it is */
@ -1701,6 +1705,7 @@ static bool set_variable(TALLOC_CTX *mem_ctx, int parmnum, void *parm_ptr,
break;
}
mark_non_default:
if (on_globals && (lp_ctx->flags[parmnum] & FLAG_DEFAULT)) {
lp_ctx->flags[parmnum] &= ~FLAG_DEFAULT;
/* we have to also unset FLAG_DEFAULT on aliases */