"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cf-agent/cf-agent.c" between
cfengine-3.15.3.tar.gz and cfengine-3.15.4.tar.gz

About: CFEngine is a configuration management system for configuring and maintaining Unix-like computers (using an own high level policy language). Community version.

cf-agent.c  (cfengine-3.15.3):cf-agent.c  (cfengine-3.15.4)
skipping to change at line 259 skipping to change at line 259
{ {
repair_lmdb_default(force_repair); repair_lmdb_default(force_repair);
} }
EvalContext *ctx = EvalContextNew(); EvalContext *ctx = EvalContextNew();
// Enable only for cf-agent eval context. // Enable only for cf-agent eval context.
EvalContextAllClassesLoggingEnable(ctx, true); EvalContextAllClassesLoggingEnable(ctx, true);
GenericAgentConfigApply(ctx, config); GenericAgentConfigApply(ctx, config);
GenericAgentDiscoverContext(ctx, config); const char *program_invocation_name = argv[0];
const char *last_dir_sep = strrchr(program_invocation_name, FILE_SEPARATOR);
const char *program_name = (last_dir_sep != NULL ? last_dir_sep + 1 : progra
m_invocation_name);
GenericAgentDiscoverContext(ctx, config, program_name);
/* FIXME: (CFE-2709) ALWAYS_VALIDATE will always be false here, since it can /* FIXME: (CFE-2709) ALWAYS_VALIDATE will always be false here, since it can
* only change in KeepPromises(), five lines later on. */ * only change in KeepPromises(), five lines later on. */
Policy *policy = SelectAndLoadPolicy(config, ctx, ALWAYS_VALIDATE, true); Policy *policy = SelectAndLoadPolicy(config, ctx, ALWAYS_VALIDATE, true);
if (!policy) if (!policy)
{ {
Log(LOG_LEVEL_ERR, "Error reading CFEngine policy. Exiting..."); Log(LOG_LEVEL_ERR, "Error reading CFEngine policy. Exiting...");
DoCleanupAndExit(EXIT_FAILURE); DoCleanupAndExit(EXIT_FAILURE);
} }
skipping to change at line 332 skipping to change at line 335
PolicyServerRemoveFile(GetWorkDir()); PolicyServerRemoveFile(GetWorkDir());
WriteAmPolicyHubFile(false); WriteAmPolicyHubFile(false);
ret = 1; ret = 1;
} }
EndAudit(ctx, CFA_BACKGROUND); EndAudit(ctx, CFA_BACKGROUND);
Nova_NoteAgentExecutionPerformance(config->input_file, start); Nova_NoteAgentExecutionPerformance(config->input_file, start);
GenericAgentFinalize(ctx, config); GenericAgentFinalize(ctx, config);
StringSetDestroy(SINGLE_COPY_CACHE);
#ifdef HAVE_LIBXML2 #ifdef HAVE_LIBXML2
xmlCleanupParser(); xmlCleanupParser();
#endif #endif
return ret; return ret;
} }
/*******************************************************************/ /*******************************************************************/
/* Level 1 */ /* Level 1 */
skipping to change at line 864 skipping to change at line 868
{ {
/* Already handled in generic_agent */ /* Already handled in generic_agent */
continue; continue;
} }
VarRef *ref = VarRefParseFromScope(cp->lval, "control_agent"); VarRef *ref = VarRefParseFromScope(cp->lval, "control_agent");
DataType value_type; DataType value_type;
const void *value = EvalContextVariableGet(ctx, ref, &value_type); const void *value = EvalContextVariableGet(ctx, ref, &value_type);
VarRefDestroy(ref); VarRefDestroy(ref);
/* If var not found, or if it's an empty list. */ /* If var not found */
if (value_type == CF_DATA_TYPE_NONE || value == NULL) if (value_type == CF_DATA_TYPE_NONE)
{ {
Log(LOG_LEVEL_ERR, "Unknown lval '%s' in agent control body", cp ->lval); Log(LOG_LEVEL_ERR, "Unknown lval '%s' in agent control body", cp ->lval);
continue; continue;
} }
/* 'files_single_copy => { }' is a perfectly valid case. */
if (StringEqual(cp->lval, CFA_CONTROLBODY[AGENT_CONTROL_FSINGLECOPY]
.lval))
{
assert(value_type == CF_DATA_TYPE_STRING_LIST);
SINGLE_COPY_LIST = value;
SINGLE_COPY_CACHE = StringSetNew();
if (WouldLog(LOG_LEVEL_VERBOSE))
{
char *rlist_str = RlistToString(SINGLE_COPY_LIST);
Log(LOG_LEVEL_VERBOSE, "Setting file single copy list to: %s
", rlist_str);
free(rlist_str);
}
continue;
}
/* Empty list is not supported for the other constraints/attributes.
*/
if (value == NULL)
{
Log(LOG_LEVEL_ERR,
"Empty list is not a valid value for '%s' attribute in agent
control body",
cp->lval);
continue;
}
if (strcmp(cp->lval, CFA_CONTROLBODY[AGENT_CONTROL_MAXCONNECTIONS].l val) == 0) if (strcmp(cp->lval, CFA_CONTROLBODY[AGENT_CONTROL_MAXCONNECTIONS].l val) == 0)
{ {
CFA_MAXTHREADS = (int) IntFromString(value); CFA_MAXTHREADS = (int) IntFromString(value);
Log(LOG_LEVEL_VERBOSE, "Setting maxconnections to %d", CFA_MAXTH READS); Log(LOG_LEVEL_VERBOSE, "Setting maxconnections to %d", CFA_MAXTH READS);
continue; continue;
} }
if (strcmp(cp->lval, CFA_CONTROLBODY[AGENT_CONTROL_CHECKSUM_ALERT_TI ME].lval) == 0) if (strcmp(cp->lval, CFA_CONTROLBODY[AGENT_CONTROL_CHECKSUM_ALERT_TI ME].lval) == 0)
{ {
CF_PERSISTENCE = (int) IntFromString(value); CF_PERSISTENCE = (int) IntFromString(value);
skipping to change at line 1007 skipping to change at line 1035
continue; continue;
} }
if (strcmp(cp->lval, CFA_CONTROLBODY[AGENT_CONTROL_DEFAULTCOPYTYPE]. lval) == 0) if (strcmp(cp->lval, CFA_CONTROLBODY[AGENT_CONTROL_DEFAULTCOPYTYPE]. lval) == 0)
{ {
DEFAULT_COPYTYPE = value; DEFAULT_COPYTYPE = value;
Log(LOG_LEVEL_VERBOSE, "Setting defaultcopytype to '%s'", DEFAUL T_COPYTYPE); Log(LOG_LEVEL_VERBOSE, "Setting defaultcopytype to '%s'", DEFAUL T_COPYTYPE);
continue; continue;
} }
if (strcmp(cp->lval, CFA_CONTROLBODY[AGENT_CONTROL_FSINGLECOPY].lval
) == 0)
{
SINGLE_COPY_LIST = value;
Log(LOG_LEVEL_VERBOSE, "Setting file single copy list");
continue;
}
if (strcmp(cp->lval, CFA_CONTROLBODY[AGENT_CONTROL_FAUTODEFINE].lval ) == 0) if (strcmp(cp->lval, CFA_CONTROLBODY[AGENT_CONTROL_FAUTODEFINE].lval ) == 0)
{ {
SetFileAutoDefineList(value); SetFileAutoDefineList(value);
Log(LOG_LEVEL_VERBOSE, "Setting file auto define list"); Log(LOG_LEVEL_VERBOSE, "Setting file auto define list");
continue; continue;
} }
if (strcmp(cp->lval, CFA_CONTROLBODY[AGENT_CONTROL_DRYRUN].lval) == 0) if (strcmp(cp->lval, CFA_CONTROLBODY[AGENT_CONTROL_DRYRUN].lval) == 0)
{ {
DONTDO = BooleanFromString(value); DONTDO = BooleanFromString(value);
 End of changes. 5 change blocks. 
11 lines changed or deleted 36 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)