Skip to content

BUG-27: apply-test-identities: a cut that prints a value and fails passes as a measurement #137

Closed

Description

@ephico2real2

Part of #115

What is wrong: A failed cut passes as a measurement in apply-test-identities.sh. The script prints each digest with echo "others=$(cut ...)". The exit status of echo replaces the exit status of cut. If cut prints a value and then fails, the run continues with that value before and after the write.

Where: examples/cmapi-sso/ldap/apply-test-identities.sh:121 and :128, on PR #112 at ecc5cb3. BUG-13 (#115) made the other steps of the measurement fail closed. These two lines stayed.

How to prove it: In the OpenLDAP stand-in of deploy/tests/ldap-identities-test.sh, replace cut in the container with a program that prints 64 zeros and exits 52. Run the script. It must fail and write nothing.

Measured or inferred: Measured on 2026-11-13 on macOS with Podman, by Codex gpt-6.1-sol and again by OB1. Before the fix: exit 0, 13 users and 10 groups written, the Secret made, and both digests equal.

Severity: Medium. The guard that says "nothing else in the directory changed" can pass on a value that was not computed.

What must hold after the fix: A cut that fails stops the run before any write, also when it prints a value. No Secret is made.

Research: POSIX shell: the exit status of a simple command with a command substitution in an argument is the status of the command itself (echo), not of the substitution. An assignment alone (x=$(cmd)) takes the status of the substitution, so set -e stops there.

Solution (inline, not applied): Assign first, then print: others=$(cut -d" " -f1 "$w/canon-sum") and echo "others=$others". The same for gate. Codex's patch C3.patch holds the full code.

Class: INV. The defect is in new INV work (#110, through #115) that is not merged.

Activity

  1. added
    bug
    class:INV
    status:open
    sev:medium
    In-Progress
    on Nov 13, 2026
  2. ephico2real2 commented on Nov 13, 2026

    @ephico2real2
    OwnerAuthor

    In-Progress: found by the second pass on PR #112 (Codex gpt-6.1-sol, 2026-11-13). The fix goes on the branch of PR #112 (draft), with its case in deploy/tests/ldap-identities-test.sh.

  3. added a commit that references this issue on Nov 13, 2026
    ffb2927
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    In-Progressbugclass:INVsev:mediumstatus:open

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions