View Single Post
olf's Avatar
Posts: 304 | Thanked: 1,246 times | Joined on Aug 2015
#29
Originally Posted by ric9K View Post
[...] Instead of
Code:
if [ ! $passhash == $encpass ]; then
Shouldn't we write this?
Code:
if [ ! x$passhash == x$encpass ]; then
No.
The original is a classic case on non-failsafe coding. Quoting per
Code:
"
is the right measure.
Plus the
Code:
==
is an unnecessary bashism, which the bash man-page explicitly does not recommend to use.

Hence using
Code:
if [ ! "$passhash" = "$encpass" ]; then
there and three lines above would make the password comparison always correctly fail, because OpenSSL is not found to calculate the password hash to compare.

Thus that has to be resolved by adapting the environment variable PATH or LD_LIBRARY_PATH or other measures.
Then you may also leave Backup-Menu's code as it is.

Last edited by olf; 2019-11-21 at 16:45.
 

The Following 4 Users Say Thank You to olf For This Useful Post: