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

shuffle() is platform-dependent

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Unconfirmed
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Built-in functions
    • Labels:
      None

      Description

      Currently the function @shuffle()@ and the underlying @SeqShuffle()@ C function are platform-dependent because they depend on consistent output from @rand()@ after @srand()@ with a seed. This should be fixed with a pseudo-random number generator. The OpenSSL libraries have that so it's not a lot of work. CFEngine aims for consistent behavior across all platforms so this is an issue.

      Please see https://github.com/cfengine/core/pull/2476#issuecomment-185109341 and the currently disabled test @01_vars/02_functions/staging/shuffle-exact.cf@ that it introduces.

      I think the documentation for @shuffle()@ should be updated for all affected versions.

        Attachments

          Activity

            People

            • Assignee:
              a10003 Eystein Maloy Stenberg
              Reporter:
              tzz Ted Zlatanov
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel