summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2008-08-13 23:36:45 +0000
committerRuss Allbery <rra@stanford.edu>2008-08-13 23:36:45 +0000
commit4b1df0699a800411c106b96974eab52b737e2d60 (patch)
tree20129e241d65309fbfdba81e625f54ebb82960ad
parent9005bfd326257207e2e3cc6d12b511453ff3b879 (diff)
Correctly handle storing of data that begins with a dash and don't
parse it as an argument to wallet-backend.
-rw-r--r--NEWS5
-rwxr-xr-xserver/wallet-backend1
-rw-r--r--tests/client/full-t.in13
3 files changed, 18 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index f8dd55d..5a6c912 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,10 @@
User-Visible wallet Changes
+wallet 0.10 (unreleased)
+
+ Correctly handle storing of data that begins with a dash and don't
+ parse it as an argument to wallet-backend.
+
wallet 0.9 (2008-04-24)
The wallet command-line client now reads the data for store from a
diff --git a/server/wallet-backend b/server/wallet-backend
index c002d89..ff63ba8 100755
--- a/server/wallet-backend
+++ b/server/wallet-backend
@@ -295,6 +295,7 @@ sub command {
# Parse command-line options.
my ($quiet);
+Getopt::Long::config ('require_order');
GetOptions ('q|quiet' => \$quiet) or exit 1;
$SYSLOG = 0 if $quiet;
diff --git a/tests/client/full-t.in b/tests/client/full-t.in
index 83c0ce9..f4ef1d3 100644
--- a/tests/client/full-t.in
+++ b/tests/client/full-t.in
@@ -12,7 +12,7 @@
# is loaded, and it's pulled in as a prerequisite for Wallet::Admin.
BEGIN { $ENV{WALLET_CONFIG} = '@abs_top_srcdir@/tests/data/wallet.conf' }
-BEGIN { our $total = 47 }
+BEGIN { our $total = 53 }
use Test::More tests => $total;
use lib '@abs_top_srcdir@/perl';
@@ -155,6 +155,17 @@ SKIP: {
is ($out, "baz\nboo\n", ' with the right output');
is ($err, '', ' and no error');
+ # Store data beginning with a dash.
+ ($out, $err, $status) = wallet ($principal, 'store', 'file', 'auto', '--',
+ '-q');
+ is ($status, 0, 'Storing data that looks like an option succeeds');
+ is ($out, '', ' with no output');
+ is ($err, '', ' and no error');
+ ($out, $err, $status) = wallet ($principal, 'get', 'file', 'auto');
+ is ($status, 0, 'Object get succeeds');
+ is ($out, '-q', ' with the right output');
+ is ($err, '', ' and no error');
+
# All done.
remctld_stop;
$admin->destroy;