Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-1153

Regression: template files are limited to CF_BUFSIZE

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Rejected
    • Priority: (None)
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.x
    • Labels:
      None

      Description

      I have a 7k template file that worked fine with 3.4. With 3.5 I get a ProgrammingError(). There was either no, or a much larger limit to the size of template files in 3.4

      After changing the ProgrammingError call to print the length and string, I get:

      2014-01-31T17:34:41-0500 verbose: Resolving variables in bundle 'temp_cf_bundle__var_cfengine_templates_nrpe_cfg'
      /misc/matrix/src/cfengine3/libpromises/expand.c:287: ProgrammingError: ExpandAndMapIteratorsFromScalar called with invalid strlen: 7383: #############################################################################

      1. Sample NRPE Config File
      2. Written by: Ethan Galstad <nagios@nagios.org>
      3. ...

      ExpandAndMapIteratorsFromScalar copies the input string into a fixed length buffer after checking the length. If this function is going to be used to process template files, it should either not copy the string or use a dynamically allocated buffer. I tried the latter and at first glance it seems to work. Someone with more knowledge of the code should determine if there is any need to copy the string at all, since I can't see it if there is.

      The corresponding promise is

      "/etc/nagios/nrpe.cfg"
      create => "true",
      edit_template => "$(sys.workdir)/templates/nrpe.cfg",
      perms => mog("644","root","root"),
      classes => if_repaired(@(update_conf_class));

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10025 Volker Hilsheimer (Inactive)
                Reporter:
                ajlill Tony Lill
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: