mirror of
https://github.com/apache/impala.git
synced 2025-12-19 18:12:08 -05:00
This change introduces a utility method FormatPermissions() that converts mode_t permission bits into a human-readable string (e.g., "drwxrwxrwt"). It correctly handles file type indicators, owner/group/other read-write-execute bits, and special bits such as setuid, setgid, and sticky. This improves log readability and debugging for file metadata-related operations by providing consistent, ls-style permission formatting. Testing: - Added unit tests validating permission string output for: - Regular files, directories, symlinks, sockets - All rwx combinations for user/group/other - setuid, setgid, and sticky bit behavior Change-Id: Ib53dbecd5c202e33b6e3b5cd3a372a77d8b1703a Reviewed-on: http://gerrit.cloudera.org:8080/23714 Reviewed-by: Riza Suminto <riza.suminto@cloudera.com> Reviewed-by: Michael Smith <michael.smith@cloudera.com> Tested-by: Michael Smith <michael.smith@cloudera.com>