Question 350
Original unofficial RHEL 10 RHCSA skill-check scenario: A maintenance job accepts a user-supplied service name and constructs dangerous shell text using `eval`. Which observation best confirms the intended outcome?
Explanation
Correct Answer
In this RHEL 10 system administration case: A maintenance job accepts a user-supplied service name and constructs dangerous shell text using `eval`. Underlying reason: A second shell evaluation can turn user input into unintended commands. The most direct, approved resolution is: Pass validated arguments directly to the intended command without `eval` string re-evaluation. Confirm it by checking: Approved service names work while shell metacharacters are rejected as data. Sustain the fix by: Use allowlisted argument formats in privileged scripts. This is the INTENDED response for the strongest objective verification result. It is a knowledge-check explanation, not a verified hands-on Red Hat exam answer;
Incorrect Answers
The downstream command receives exactly the same number of distinct filenames. That is not sufficient for the reported RHEL task, because a second shell evaluation can turn user input into unintended commands.
The report contains both successes and the named failed host. That is not sufficient for the reported RHEL task, because a second shell evaluation can turn user input into unintended commands.
A failed check skips the restart and a successful check permits it. That is not sufficient for the reported RHEL task, because a second shell evaluation can turn user input into unintended commands.