diff options
| author | Russ Allbery <rra@stanford.edu> | 2008-02-12 23:38:36 +0000 | 
|---|---|---|
| committer | Russ Allbery <rra@stanford.edu> | 2008-02-12 23:38:36 +0000 | 
| commit | 5dd1bb69f28e1a38259dd939cfd00469c5b786eb (patch) | |
| tree | 63514dc4c4e5dabbfec357f743b54c535deeca43 | |
| parent | 54ccb6083d69da03c71d01a271a09554e4d63e4f (diff) | |
wallet-backend now supports a -q flag, which disables syslog logging.
| -rw-r--r-- | NEWS | 2 | ||||
| -rwxr-xr-x | server/wallet-backend | 26 | ||||
| -rw-r--r-- | tests/data/cmd-wrapper.in | 2 | 
3 files changed, 25 insertions, 5 deletions
| @@ -13,6 +13,8 @@ wallet 0.8 (unreleased)      environment variable WALLET_CONFIG and loads configuration from the      file specified there instead of /etc/wallet/wallet.conf if it is set. +    wallet-backend now supports a -q flag, which disables syslog logging. +      Add a full end-to-end test suite to catch protocol mismatches between      the client and server, such as the one fixed in this release. diff --git a/server/wallet-backend b/server/wallet-backend index 1a259d5..c002d89 100755 --- a/server/wallet-backend +++ b/server/wallet-backend @@ -13,11 +13,14 @@ our $ID = q$Id$;  ##############################################################################  use strict; + +use Getopt::Long qw(GetOptions);  use Sys::Syslog qw(openlog syslog);  use Wallet::Server; -# Set to zero to suppress syslog logging, which is used only for testing.  Set -# to a reference to a string to append messages to that string instead. +# Set to zero to suppress syslog logging, which is used for testing and for +# the -q option.  Set to a reference to a string to append messages to that +# string instead.  our $SYSLOG;  $SYSLOG = 1 unless defined $SYSLOG; @@ -289,7 +292,15 @@ sub command {      }      success (@_);  } + +# Parse command-line options. +my ($quiet); +GetOptions ('q|quiet' => \$quiet) or exit 1; +$SYSLOG = 0 if $quiet; + +# Run the command.  command (@ARGV); +  __END__  ############################################################################## @@ -305,7 +316,7 @@ wallet-backend - Wallet server for storing and retrieving secure data  =head1 SYNOPSIS -B<wallet-backend> I<command> [I<args> ...] +B<wallet-backend> [B<-q>] I<command> [I<args> ...]  =head1 DESCRIPTION @@ -326,7 +337,14 @@ over and above the checking already done by the rest of the wallet code.  =head1 OPTIONS -B<wallet-backend> takes no traditional options. +=over 4 + +=item B<--quiet>, B<-q> + +If this option is given, B<wallet-backend> will not log its actions to +syslog. + +=back  =head1 COMMANDS diff --git a/tests/data/cmd-wrapper.in b/tests/data/cmd-wrapper.in index a45edc8..e119002 100644 --- a/tests/data/cmd-wrapper.in +++ b/tests/data/cmd-wrapper.in @@ -7,4 +7,4 @@  WALLET_CONFIG='@abs_top_srcdir@/tests/data/wallet.conf'  export WALLET_CONFIG  exec perl -I'@abs_top_srcdir@/perl' '@abs_top_srcdir@/server/wallet-backend' \ -    "$@" +    -q "$@" | 
