You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2026/09/16 08:13:00 UTC
[jira] [Updated] (HDFS-17980) Propagate Rename.TO_TRASH in authorization context for external enforcers
[ https://issues.apache.org/jira/browse/HDFS-17980?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated HDFS-17980:
----------------------------------
Labels: pull-request-available (was: )
> Propagate Rename.TO_TRASH in authorization context for external enforcers
> -------------------------------------------------------------------------
>
> Key: HDFS-17980
> URL: https://issues.apache.org/jira/browse/HDFS-17980
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: Sadanand Shenoy
> Assignee: Sadanand Shenoy
> Priority: Major
> Labels: pull-request-available
>
> When HDFS Trash is enabled, {{rm}} is executed as an internal {{rename}} to {{.Trash}} using {{{}Options.Rename.TO_TRASH{}}}.
> Today, external authorization plugins (for example Ranger via {{{}checkPermissionWithContext{}}}) receive {{{}operationName=rename{}}}, but do not get an explicit trash-intent signal. As a result, {{rm}} (to trash) and {{mv}} appear identical from authorization/audit context.
> This JIRA proposes adding and propagating a dedicated context flag (for example {{{}renameToTrash{}}}) in {{INodeAttributeProvider.AuthorizationContext}} so external enforcers can distinguish:
> * {{rm}} with trash enabled -> {{{}operationName=rename{}}}, {{renameToTrash=true}}
> * {{mv}} -> {{{}operationName=rename{}}}, {{renameToTrash=false}}
> * {{rm -skipTrash}} -> {{operationName=delete}}
> Scope (HDFS side)
> * Add {{renameToTrash}} field to {{AuthorizationContext}} and its builder/accessors.
> * Propagate the flag through {{FSPermissionChecker}} when building context for {{{}checkPermissionWithContext{}}}.
> * In {{{}FSNamesystem.renameTo(..., Options.Rename... options){}}}, set the flag based on presence of {{{}Options.Rename.TO_TRASH{}}}, and clear it in {{finally}} to avoid ThreadLocal leakage.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org