From 428c88bb0a08ba2eb06c7f5181f7cbee2f7ee398 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Thu, 7 Feb 2008 01:44:28 +0000 Subject: Add a check command to the wallet server to determine whether an object already exists. --- server/wallet-backend | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'server') 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 -# 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 ACL. Display the name, numeric ID, and entries of the ACL . +=item check + +Check whether an object of type and name already exists. If +it does, prints C; if not, prints C. + =item create Create a new object of type with name . With some backends, -- cgit v1.2.3