Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bug: action with command that exits with errorcode ! 0 is reported as OK #316

@Blizzke

Description

@Blizzke

Description
While trying to use cp to copy a file to /etc (since file.copy doesn't support privilege elevation at this point) comtrya reports a completed execution, no errors.

If you run it in trace mode however, you see that the command failed with exit code 1,

Steps to reproduce

actions:
  - action: command.run
    command: cp
    args:
      - -f
      - manifests/tools/zsh/files/zshenv
      - /etc/zsh/

The above action tries to copy a file into /etc without sudo.
Trace will show:

TRACE execute:{manifest="manifests.etc"}:{action=command.run}: exit code: 1
TRACE execute:{manifest="manifests.etc"}:{action=command.run}: stdout: 
TRACE execute:{manifest="manifests.etc"}:{action=command.run}: stderr: cp: cannot remove '/etc/zsh/zshenv': Permission denied
INFO execute:{manifest="manifests.etc"}: Completed

Expected behaviour
Visible error

Environment

  • OS: manjaro
  • Version: 0.8.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions