[ 
https://issues.apache.org/jira/browse/IMPALA-13941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18042060#comment-18042060
 ] 

ASF subversion and git services commented on IMPALA-13941:
----------------------------------------------------------

Commit d4707ff1973255ed29f2d7b7740d809f26d80703 in impala's branch 
refs/heads/master from Arnab Karmakar
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=d4707ff19 ]

IMPALA-13941: Add helper to format file permissions as UNIX-style string

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 <[email protected]>
Reviewed-by: Michael Smith <[email protected]>
Tested-by: Michael Smith <[email protected]>


> Show the current permissions of /var/tmp in error message
> ---------------------------------------------------------
>
>                 Key: IMPALA-13941
>                 URL: https://issues.apache.org/jira/browse/IMPALA-13941
>             Project: IMPALA
>          Issue Type: Improvement
>            Reporter: Quanlong Huang
>            Assignee: Arnab Karmakar
>            Priority: Major
>              Labels: newbie, ramp-up
>             Fix For: Impala 5.0.0
>
>
> We have an error message like this:
> {code:java}
> Error: The permissions on /var/tmp must precisely match "drwxrwxrwt". This 
> directory is used by the Kerberos replay cache. To rectify this issue, run 
> "chmod 01777 /var/tmp" as root.{code}
> It'd be helpful to also report the current permissions. Related codes:
> {code:cpp}
>   if ((st.st_mode & 01777) != 01777) {
>     return Status("Error: The permissions on /var/tmp must precisely match "
>         "\"drwxrwxrwt\". This directory is used by the Kerberos replay cache. 
> To "
>         "rectify this issue, run \"chmod 01777 /var/tmp\" as root.");
>   }{code}
> [https://github.com/apache/impala/blob/5f06f4743007bda13d1d45c2a16adab472e7ba23/be/src/rpc/authentication.cc#L1236-L1240]
> Tests can be added in tests/custom_cluster/test_logging.py



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to