Example #1
0
static void DeleteTypeContext(Policy *policy, enum typesequence type, const ReportContext *report_context)
{
    switch (type)
    {
    case kp_classes:
        HashVariables(policy, THIS_BUNDLE, report_context);
        break;

    case kp_environments:
        DeleteEnvironmentsContext();
        break;

    case kp_files:

        ConnectionsCleanup();
        break;

    case kp_processes:
        break;

    case kp_storage:
#ifndef __MINGW32__
    {
        Attributes a = { {0} };
        CfOut(cf_verbose, "", " -> Number of changes observed in %s is %d\n", VFSTAB[VSYSTEMHARDCLASS], FSTAB_EDITS);

        if (FSTAB_EDITS && FSTABLIST && !DONTDO)
        {
            if (FSTABLIST)
            {
                SaveItemListAsFile(FSTABLIST, VFSTAB[VSYSTEMHARDCLASS], a, NULL, report_context);
                DeleteItemList(FSTABLIST);
                FSTABLIST = NULL;
            }
            FSTAB_EDITS = 0;
        }

        if (!DONTDO && CF_MOUNTALL)
        {
            CfOut(cf_verbose, "", " -> Mounting all filesystems\n");
            MountAll();
        }
    }
#endif /* !__MINGW32__ */
        break;

    case kp_packages:

        ExecuteScheduledPackages();

        CleanScheduledPackages();
        break;

    default:

        /* Deinitialization is not required */
        ;

    }
}
Example #2
0
static void DeleteTypeContext(Policy *policy, TypeSequence type, const ReportContext *report_context)
{
    switch (type)
    {
    case TYPE_SEQUENCE_CONTEXTS:
        HashVariables(policy, THIS_BUNDLE, report_context);
        break;

    case TYPE_SEQUENCE_ENVIRONMENTS:
        DeleteEnvironmentsContext();
        break;

    case TYPE_SEQUENCE_FILES:

        ConnectionsCleanup();
        break;

    case TYPE_SEQUENCE_PROCESSES:
        break;

    case TYPE_SEQUENCE_STORAGE:
#ifndef __MINGW32__
    {
        Attributes a = { {0} };
        CfOut(OUTPUT_LEVEL_VERBOSE, "", " -> Number of changes observed in %s is %d\n", VFSTAB[VSYSTEMHARDCLASS], FSTAB_EDITS);

        if (FSTAB_EDITS && FSTABLIST && !DONTDO)
        {
            if (FSTABLIST)
            {
                SaveItemListAsFile(FSTABLIST, VFSTAB[VSYSTEMHARDCLASS], a, NULL, report_context);
                DeleteItemList(FSTABLIST);
                FSTABLIST = NULL;
            }
            FSTAB_EDITS = 0;
        }

        if (!DONTDO && CF_MOUNTALL)
        {
            CfOut(OUTPUT_LEVEL_VERBOSE, "", " -> Mounting all filesystems\n");
            MountAll();
        }
    }
#endif /* !__MINGW32__ */
    break;

    case TYPE_SEQUENCE_PACKAGES:

        ExecuteScheduledPackages();

        CleanScheduledPackages();
        break;

    default:

        /* Deinitialization is not required */
        ;

    }
}