HDFS-10455. Logging the username when deny the setOwner operation. Contributed by Rakesh R.
(cherry picked from commit1c5708f6de
) (cherry picked from commitc895f08936
)
This commit is contained in:
parent
54bbdb4c02
commit
ac12063eeb
|
@ -241,6 +241,9 @@ Release 2.7.4 - UNRELEASED
|
||||||
HDFS-11615. FSNamesystemLock metrics can be inaccurate due to millisecond precision.
|
HDFS-11615. FSNamesystemLock metrics can be inaccurate due to millisecond precision.
|
||||||
(Erik Krogen via zhz)
|
(Erik Krogen via zhz)
|
||||||
|
|
||||||
|
HDFS-10455. Logging the username when deny the setOwner operation.
|
||||||
|
(Tianyi Xu and Rakesh R via Brahma Reddy Battula)
|
||||||
|
|
||||||
Release 2.7.3 - 2016-08-25
|
Release 2.7.3 - 2016-08-25
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -78,10 +78,12 @@ public class FSDirAttrOp {
|
||||||
fsd.checkOwner(pc, iip);
|
fsd.checkOwner(pc, iip);
|
||||||
if (!pc.isSuperUser()) {
|
if (!pc.isSuperUser()) {
|
||||||
if (username != null && !pc.getUser().equals(username)) {
|
if (username != null && !pc.getUser().equals(username)) {
|
||||||
throw new AccessControlException("Non-super user cannot change owner");
|
throw new AccessControlException("User " + username
|
||||||
|
+ " is not a super user (non-super user cannot change owner).");
|
||||||
}
|
}
|
||||||
if (group != null && !pc.containsGroup(group)) {
|
if (group != null && !pc.containsGroup(group)) {
|
||||||
throw new AccessControlException("User does not belong to " + group);
|
throw new AccessControlException(
|
||||||
|
"User " + username + " does not belong to " + group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unprotectedSetOwner(fsd, src, username, group);
|
unprotectedSetOwner(fsd, src, username, group);
|
||||||
|
|
Loading…
Reference in New Issue