Invalid signpassword error when encryptkey and signkey aren't even set
With backupninja 1.0.2-1 from Debian unstable I'm getting a fatal error that "The signpassword option must be set because signkey is different from encryptkey."
I am trying to do symmetric encryption and have not set signpassword, or signkey, or encryptkey or signkey, or encryptkey. They are all zero length strings.
I believe the error happens because the order of tests in the if is reversed from the error message stated purpose:
[ -n "$signpassword" -a -n "$signkey" -a -n "$encryptkey" -a "$signkey" != "$encryptkey" ]
[ false and false and false and false ]
I can set signkey and encryptkey to the same value and still get the error if signpassword is not set.
I think it is better expressed this way:
if the encryptkey is set but it differs from the sign key
if [ -n "encryptkey" -a "
signkey" != "$encryptkey" ]; then
# then if the signpassword isn't set, die
[ -n "$signpassword" ] || fatal "The signpassword option must be set because signkey is different from encryptkey."
fi
otherwise we're OK with just the signkey set or all three unset
The test was added with signpassword in c5738b11.