From 4f863ccc9531130be3f4aecea341a0e8a66c6f8c Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sat, 20 Feb 2010 20:30:37 -0800 Subject: wallet-backend gets the third store argument from stdin if missing If there is no third argument to store, read it from standard input instead. This is the preferred way of running wallet-backend, using stdin=last support from remctl 2.14 and later. Receiving the third argument as a regular argument continues to be supported for backward compatibility. --- server/wallet-backend | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'server') diff --git a/server/wallet-backend b/server/wallet-backend index 7780758..453aa79 100755 --- a/server/wallet-backend +++ b/server/wallet-backend @@ -284,7 +284,11 @@ sub command { failure ($server->error, @_); } } elsif ($command eq 'store') { - check_args (3, 3, [3], @args); + check_args (2, 3, [3], @args); + if (@args == 2) { + local $/; + $args[2] = ; + } splice (@_, 3); $server->store (@args) or failure ($server->error, @_); } else { @@ -536,10 +540,11 @@ name, the owner, any specific ACLs set on the object, the expiration if any, and the user, remote host, and time when the object was created, last stored, and last downloaded. -=item store +=item store [] Stores for the object identified by and for later -retrieval with C. Not all object types support this. +retrieval with C. Not all object types support this. If is +not given as an argument, it will be read from standard input. Currently, is limited to not containing nul characters and may therefore not be binary data, and is limited by the maximum command line -- cgit v1.2.3