Skip to content

Commit a0d2be8

Browse files
committed
fix: Set path to / when the operation contentSummary is called on /i
1 parent 53c9cd6 commit a0d2be8

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ All notable changes to this project will be documented in this file.
88

99
- BREAKING: Only send a subset of the fields sufficient for most use-cases to OPA for performance reasons.
1010
The old behavior of sending all fields can be restored by setting `hadoop.security.authorization.opa.extended-requests` to `true` ([#XX]).
11-
- Bump `okio` to 1.17.6 and to 3.9.1 afterwards to get rid of CVE-2023-3635 ([#46], [#XX]).
11+
- Bump `okio` to 1.17.6 and to 3.9.1 afterwards to get rid of CVE-2023-3635 ([#46], [#XX]).
12+
13+
### Fixed
14+
15+
- Set path to `/` when the operation `contentSummary` is called on `/`. Previously path was set to `null` ([#XX]).
1216

1317
[#46]: https://github.com/stackabletech/hdfs-utils/pull/46
1418

src/main/java/tech/stackable/hadoop/StackableAccessControlEnforcer.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ public void checkPermission(String fsOwner, String supergroup,
124124

125125
@Override
126126
public void checkPermissionWithContext(INodeAttributeProvider.AuthorizationContext authzContext) throws AccessControlException {
127+
// When executing "hdfs dfs -du /" the path is set to null. This does not worsen security, as "/" is the
128+
// highest level of access that a user can have.
129+
if (authzContext.getOperationName().equals("contentSummary") && authzContext.getPath() == null) {
130+
authzContext.setPath("/");
131+
}
132+
127133
final Object query;
128134
if (this.extendedRequests) {
129135
query = new OpaAllowQuery(new OpaAllowQuery.OpaAllowQueryInput(authzContext));

0 commit comments

Comments
 (0)