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

cf-execd breaks exec_command in body executor control

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Unconfirmed
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cf-execd
    • Labels:
      None

      Description

      cf-execd unconditionally adds " -Dfrom_cfexecd" to exec_command in body executor control, in cf-execd-runner.c line 185:

      <pre>
      if (strlen(config->exec_command) > 0)
      {
      strlcpy(cmd, config->exec_command, CF_BUFSIZE);

      if (!strstr(cmd, "-Dfrom_cfexecd"))

      { strcat(cmd, " -Dfrom_cfexecd"); }

      }
      </pre>

      This breaks exec_command that ends with anything other than cf-agent invocation.
      Bug was introduced in d4bca14e43a3ca7fd074360564046dcc4be30be9.

      Steps to reproduce:

      <pre>
      body executor control
      {
      exec_command => "$(sys.workdir)/bin/cf-agent -f failsafe.cf && $(sys.workdir)/bin/cf-agent | grep anything";
      }
      </pre>

      results in:
      grep: unknown devices method

        Attachments

          Activity

            People

            Assignee:
            a10040 Kristian Amlie
            Reporter:
            sagb s a
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: