diff options
author | Russ Allbery <rra@stanford.edu> | 2010-03-03 22:37:18 -0800 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2010-03-03 22:37:18 -0800 |
commit | a131c767d1eee7b98170962f7f9d4063be69e576 (patch) | |
tree | a1c5a182764adc50faca2f804387c081ef22ee27 /server/wallet-report | |
parent | 6c1f7d325239f305b9bf6a4503165cefae1ee3d8 (diff) |
Add auditing for names that violate the naming policy
Add an audit command to wallet-report and one audit: objects name,
which returns all objects that do not pass the local naming policy.
The corresponding Wallet::Report method is audit().
Wallet::Config::verify_name may now be called with an undefined third
argument (normally the user attempting to create an object). This
calling convention is used when auditing, and the local policy
function should select the correct policy to apply for useful audit
results.
Diffstat (limited to 'server/wallet-report')
-rwxr-xr-x | server/wallet-report | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/server/wallet-report b/server/wallet-report index a6b3b8d..caa7e2c 100755 --- a/server/wallet-report +++ b/server/wallet-report @@ -35,6 +35,16 @@ sub command { for my $acl (sort { $$a[1] cmp $$b[1] } @acls) { print "$$acl[1] (ACL ID: $$acl[0])\n"; } + } elsif ($command eq 'audit') { + die "too many arguments to audit\n" if @args > 2; + die "too few arguments to audit\n" if @args < 2; + my @objects = $report->audit (@args); + if (!@objects and $report->error) { + die $report->error, "\n"; + } + for my $object (@objects) { + print join (' ', @$object), "\n"; + } } elsif ($command eq 'objects') { die "too many arguments to objects\n" if @args > 2; my @objects = $report->objects (@args); @@ -129,6 +139,15 @@ any identifier containing that string. =back +=item audit objects name + +Returns all objects that violate the current site naming policy. Objects +will be listed in the form: + + <type> <name> + +There will be one line per object. + =item objects =item objects acl <acl> |