summaryrefslogtreecommitdiff
path: root/server/wallet-admin
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2009-06-09 16:39:08 -0700
committerRuss Allbery <rra@stanford.edu>2009-06-09 16:39:08 -0700
commitc2cde5918af1882ee63324fd9e09f07c8e6e5cc9 (patch)
tree8f6959424e55c5bd559ab466bcfcef0e7c3f18f1 /server/wallet-admin
parente455057f2fe19dd27ee1b03083454eceb07d3043 (diff)
Add owners report
Add a new report owners command to wallet-admin and corresponding report_owners() method to Wallet::Admin, which returns all ACL lines on owner ACLs for matching objects.
Diffstat (limited to 'server/wallet-admin')
-rwxr-xr-xserver/wallet-admin39
1 files changed, 38 insertions, 1 deletions
diff --git a/server/wallet-admin b/server/wallet-admin
index 0daa986..b5674c5 100755
--- a/server/wallet-admin
+++ b/server/wallet-admin
@@ -3,7 +3,7 @@
# wallet-admin -- Wallet server administrative commands.
#
# Written by Russ Allbery <rra@stanford.edu>
-# Copyright 2008 Board of Trustees, Leland Stanford Jr. University
+# Copyright 2008, 2009 Board of Trustees, Leland Stanford Jr. University
#
# See LICENSE for licensing terms.
@@ -64,6 +64,22 @@ sub command {
} else {
die "only objects or acls are supported for list\n";
}
+ } elsif ($command eq 'report') {
+ die "too few arguments to report\n" if @args < 1;
+ my $report = shift @args;
+ if ($report eq 'owners') {
+ die "too many arguments to report owners\n" if @args > 2;
+ die "too few arguments to report owners\n" if @args < 2;
+ my @lines = $admin->report_owners (@args);
+ if (!@lines and $admin->error) {
+ die $admin->error, "\n";
+ }
+ for my $line (@lines) {
+ print join (' ', @$line), "\n";
+ }
+ } else {
+ die "unknown report type $report\n";
+ }
} elsif ($command eq 'register') {
die "too many arguments to register\n" if @args > 3;
die "too few arguments to register\n" if @args < 3;
@@ -168,6 +184,27 @@ default as part of database initialization, so this command is used
primarily to register local implementations of additional object types or
ACL schemes.
+=item report <type> [ <arg> ... ]
+
+Runs a wallet report. The currently supported report types are:
+
+=over 4
+
+=item report owners <type-pattern> <name-pattern>
+
+Returns a list of all ACL lines in owner ACLs for all objects matching
+both <type-pattern> and <name-pattern>. These can be the type or name of
+objects or they can be patterns using C<%> as the wildcard character
+following the normal rules of SQL patterns.
+
+The output will be one line per ACL line in the form:
+
+ <scheme> <identifier>
+
+with duplicates suppressed.
+
+=back
+
=back
=head1 SEE ALSO