Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CFE-4244: Fix RlistEqual comparison on lists of different lengths (3.21.x) #5320

Merged
merged 1 commit into from
Sep 14, 2023

Commits on Sep 13, 2023

  1. Fix RlistEqual comparison on lists of different lengths

    The original issue that leads to this is the fact that the cache
    for execresult and execresult_as_data were mixed. This is caused by two
    separate issues:
    
    * The function cache uses the args list as key and discards the function
      itself. This means different function with the same args are considered
      identical, and cache is reused.
    * The args are passed as an Rlist, and the used Rlist comparison ignores the
      additional items of the longest list when comparing two lists of
      different lengths, leading to treating execresult and execresult_as_data
      as identical when using the same command and shell args.
    
    This PR only fixes the specific case of execresult, but leaves other
    function cache issues (e.g. host2ip vs. ip2host could be confused).
    
    (cherry picked from commit d5a7372)
    Signed-off-by: Lars Erik Wik <[email protected]>
    amousset authored and larsewi committed Sep 13, 2023
    Configuration menu
    Copy the full SHA
    59f640f View commit details
    Browse the repository at this point in the history