Error when Run Command Action is added "sudo -S -p" in the beginning of the command formation.When the user provides the command it gets appended to "sudo -S -p".
The Expected behavior is to work fine until the user provides sudo in his input which is when the final command contains two sudo in it and it gives the error.
For example when user provides command "pwd" or "ls -ltr" the command formation woluld look like this - "sudo -S -p pwd" and it works fine, but when the user gives sudo in his input the command formation looks like this - "sudo -S -p sudo -i -u ncqadm -S env | grep SECUDIR" which is why it fails
Release : 12.3.X
Component : ACTIONS PACKS
There are two workarounds that can be followed for this issue, Kindly check below.
There is a workaround for this issue that we can use as follows.
1 Create a file containing all the specified commands.
2. Use "PUT_FILE" action to transfer the file to target machine.
3. Use "RUN_COMMAND" action to execute the above file using SUDO.
Save the output of the "sudo -i -u" command to a temporary file, then read it as the current user.
Fix is under progress from sustaining engineering team.