Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #173 from adamretter/develop

Security check in Backups Module
  • Loading branch information...
commit b8377c2a98de0f1b8b3e02e203ee5f441316d373 2 parents 481d10e + cfb6c55
@dizzzz dizzzz authored
View
4 src/org/exist/backup/xquery/ListBackups.java
@@ -69,6 +69,10 @@ public ListBackups( XQueryContext context )
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
+ if(!context.getEffectiveUser().hasDbaRole()) {
+ throw new XPathException("You must be a DBA to list available backups");
+ }
+
final String exportDir = args[0].getStringValue();
File dir = new File( exportDir );
View
4 src/org/exist/backup/xquery/RetrieveBackup.java
@@ -63,6 +63,10 @@ public RetrieveBackup( XQueryContext context )
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
+ if(!context.getEffectiveUser().hasDbaRole()) {
+ throw new XPathException("You must be a DBA to retrieve a backup");
+ }
+
final String exportDir = args[0].getStringValue();
File dir = new File( exportDir );
Please sign in to comment.
Something went wrong with that request. Please try again.