dajiaohuang opened a new pull request, #4245:
URL: https://github.com/apache/ambari/pull/4245

   `chmod_recursive` handles file-only and directory-only flags incorrectly 
when the agent runs as root: file-only flags are ignored, and directory-only 
flags raise KeyError for `f`. Its non-root implementation also requires an 
argument that defaults to False in the root implementation, and does not 
request sudo when invoking find/chmod.
   
   Check the file flag independently, give both implementations the same 
default, and request sudo for the non-root command. This addresses the concrete 
inconsistencies documented in AMBARI-26628.
   
   Validation: four mocked regression tests against the actual module on 
Linux/Python 3.12 fail before the change (two failures and two errors), and all 
four pass after it. Ruff checks and git diff --check pass. No host permissions 
or real cluster were changed. Full Ambari build and cluster integration tests 
were not run.
   
   Related: https://issues.apache.org/jira/browse/AMBARI-26628
   
   Generated-by: OpenAI Codex (GPT-6.1-sol)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to