Pass filename as maxpasswd argument

The 2.0 version of maxpasswd requires that the filename is given as the
first argument. Only 2.1 and newer versions check for the default key
file.
This commit is contained in:
Markus Mäkelä
2017-05-30 14:10:21 +03:00
parent 684e2e153f
commit 6c742030b4

View File

@ -31,7 +31,7 @@ void try_password(TestConnections* Test, char * pass)
*/ */
Test->tprintf("Encrypting password: %s", pass); Test->tprintf("Encrypting password: %s", pass);
Test->set_timeout(30); Test->set_timeout(30);
int rc = Test->ssh_maxscale(true, "maxpasswd '%s' | tr -dc '[:xdigit:]' > /tmp/pw.txt && " int rc = Test->ssh_maxscale(true, "maxpasswd /var/lib/maxscale/ '%s' | tr -dc '[:xdigit:]' > /tmp/pw.txt && "
"sed -i 's/user=.*/user=test/' /etc/maxscale.cnf && " "sed -i 's/user=.*/user=test/' /etc/maxscale.cnf && "
"sed -i \"s/passwd=.*/passwd=$(cat /tmp/pw.txt)/\" /etc/maxscale.cnf && " "sed -i \"s/passwd=.*/passwd=$(cat /tmp/pw.txt)/\" /etc/maxscale.cnf && "
"service maxscale restart && " "service maxscale restart && "