private void rejectRemoteAdminIfDisabled(final AdminCallbackHandler cbh) throws RemoteAdminAccessException { /* * If the secure admin config is not available then do not try to * enforce the remote access restrictions. */ if (secureAdmin == null) { return; } /* * If the request contains the special admin indicator, then it's a * message from the DAS to an instance and it's OK for it to be remote * even if secure admin is not enabled. */ if (secureAdmin.getSpecialAdminIndicator().equals(cbh.adminIndicator())) { return; } /* * If the request has an admin token then it can be a remote request * from an instance start-up (for example). Accept it. */ if (cbh.tkn() != null) { return; } rejectRemoteAdminIfDisabled(cbh.getRemoteHost()); }
new Object[] {cbh.pw().getUserName(), cbh.clientPrincipal() == null ? "null" : cbh.clientPrincipal().getName(), cbh.tkn(), cbh.adminIndicator(), cbh.remoteHost()}); new Object[] {cbh.pw().getUserName(), cbh.clientPrincipal() == null ? "null" : cbh.clientPrincipal().getName(), cbh.tkn(), cbh.adminIndicator(), cbh.remoteHost(), cmd}); new Object[] {cbh.pw().getUserName(), cbh.clientPrincipal() == null ? "null" : cbh.clientPrincipal().getName(), cbh.tkn(), cbh.adminIndicator(), cbh.remoteHost(), cmd});