diff options
author | Russ Allbery <rra@stanford.edu> | 2008-02-07 01:44:28 +0000 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2008-02-07 01:44:28 +0000 |
commit | 428c88bb0a08ba2eb06c7f5181f7cbee2f7ee398 (patch) | |
tree | e825ea00b3ceb0074bbd8183ea16fceafb6c135d /server | |
parent | e733132938bc4fc74584b9a7c0f5441eb640e617 (diff) |
Add a check command to the wallet server to determine whether an object
already exists.
Diffstat (limited to 'server')
-rwxr-xr-x | server/wallet-backend | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/server/wallet-backend b/server/wallet-backend index fe319e1..967f9b4 100755 --- a/server/wallet-backend +++ b/server/wallet-backend @@ -4,7 +4,7 @@ our $ID = q$Id$; # wallet-backend -- Wallet server for storing and retrieving secure data. # # Written by Russ Allbery <rra@stanford.edu> -# Copyright 2007 Board of Trustees, Leland Stanford Jr. University +# Copyright 2007, 2008 Board of Trustees, Leland Stanford Jr. University # # See LICENSE for licensing terms. @@ -178,6 +178,14 @@ sub command { } else { error "unknown command acl $action"; } + } elsif ($command eq 'check') { + check_args (2, 2, [], @args); + my $status = $server->check (@args); + if (!defined ($status)) { + failure ($server->error, @_); + } else { + print $status ? "yes\n" : "no\n"; + } } elsif ($command eq 'create') { check_args (2, 2, [], @args); $server->create (@args) or failure ($server->error, @_); @@ -383,6 +391,11 @@ caution when removing entries from the C<ADMIN> ACL. Display the name, numeric ID, and entries of the ACL <id>. +=item check <type> <name> + +Check whether an object of type <type> and name <name> already exists. If +it does, prints C<yes>; if not, prints C<no>. + =item create <type> <name> Create a new object of type <type> with name <name>. With some backends, |