Merge changes Ie7c9ba92,I0a220c73

* changes:
  AdminQueryShell: Update Javadoc
  AdminQueryShell: Reduce scope of try-catch to necessary calls
This commit is contained in:
David Pursehouse
2016-02-12 08:44:18 +00:00
committed by Gerrit Code Review

View File

@@ -46,17 +46,17 @@ final class AdminQueryShell extends SshCommand {
protected void run() throws Failure {
try {
checkPermission();
final QueryShell shell = factory.create(in, out);
shell.setOutputFormat(format);
if (query != null) {
shell.execute(query);
} else {
shell.run();
}
} catch (PermissionDeniedException err) {
throw new UnloggedFailure("fatal: " + err.getMessage());
}
QueryShell shell = factory.create(in, out);
shell.setOutputFormat(format);
if (query != null) {
shell.execute(query);
} else {
shell.run();
}
}
/**
@@ -65,7 +65,8 @@ final class AdminQueryShell extends SshCommand {
* As the @RequireCapability guards at various entry points of internal
* commands implicitly add administrators (which we want to avoid), we also
* check permissions within QueryShell and grant access only to those who
* canPerformRawQuery, regardless of whether they are administrators or not.
* can access the database, regardless of whether they are administrators or
* not.
*
* @throws PermissionDeniedException
*/