Repository: flume Updated Branches: refs/heads/flume-1.6 1b0f051b6 -> 8ccbb0b4b
FLUME-2639. SecureThriftRpcClient client privileged calls throw IllegalAccessError (Johny Rufus via Hari) Project: http://git-wip-us.apache.org/repos/asf/flume/repo Commit: http://git-wip-us.apache.org/repos/asf/flume/commit/8ccbb0b4 Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/8ccbb0b4 Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/8ccbb0b4 Branch: refs/heads/flume-1.6 Commit: 8ccbb0b4b8767c87d680a5c6e5221f0ec280e88e Parents: 1b0f051 Author: Hari Shreedharan <[email protected]> Authored: Tue Mar 10 13:17:15 2015 -0700 Committer: Hari Shreedharan <[email protected]> Committed: Tue Mar 10 13:17:15 2015 -0700 ---------------------------------------------------------------------- .../org/apache/flume/api/SecureThriftRpcClient.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flume/blob/8ccbb0b4/flume-ng-auth/src/main/java/org/apache/flume/api/SecureThriftRpcClient.java ---------------------------------------------------------------------- diff --git a/flume-ng-auth/src/main/java/org/apache/flume/api/SecureThriftRpcClient.java b/flume-ng-auth/src/main/java/org/apache/flume/api/SecureThriftRpcClient.java index 7316e1b..f31582c 100644 --- a/flume-ng-auth/src/main/java/org/apache/flume/api/SecureThriftRpcClient.java +++ b/flume-ng-auth/src/main/java/org/apache/flume/api/SecureThriftRpcClient.java @@ -94,11 +94,9 @@ public class SecureThriftRpcClient extends ThriftRpcClient { this.privilegedExecutor.execute( new PrivilegedExceptionAction<Void>() { public Void run() throws FlumeException { - try { - UgiSaslClientTransport.super.open(); - } catch (TTransportException e) { - throw new FlumeException("Failed to open SASL transport", e); - } + // this is a workaround to using UgiSaslClientTransport.super.open() + // which results in IllegalAccessError + callSuperClassOpen(); return null; } }); @@ -109,5 +107,13 @@ public class SecureThriftRpcClient extends ThriftRpcClient { throw new FlumeException("Failed to open SASL transport", e); } } + + private void callSuperClassOpen() throws FlumeException { + try { + super.open(); + } catch (TTransportException e) { + throw new FlumeException("Failed to open SASL transport", e); + } + } } }
