1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-05 16:15:50 +03:00

MCOL-1498 - add prompt for password on non-distibute installs

This commit is contained in:
David Hill
2018-08-02 10:59:38 -05:00
parent 581fe7a317
commit 5d245c8932

View File

@@ -3090,7 +3090,9 @@ int main(int argc, char *argv[])
//check if dbrm data resides in older directory path and inform user if it does //check if dbrm data resides in older directory path and inform user if it does
dbrmDirCheck(); dbrmDirCheck();
if ( IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM && pmNumber == 1) { if ( ( IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM ) ||
( (IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM) && pmwithum ) )
{
//run the mysql / mysqld setup scripts //run the mysql / mysqld setup scripts
cout << endl << "===== Running the MariaDB ColumnStore MariaDB Server setup scripts =====" << endl << endl; cout << endl << "===== Running the MariaDB ColumnStore MariaDB Server setup scripts =====" << endl << endl;
@@ -3098,7 +3100,61 @@ int main(int argc, char *argv[])
// call the mysql setup scripts // call the mysql setup scripts
mysqlSetup(); mysqlSetup();
sleep(5); sleep(3);
}
if ( IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM ||
pmNumber > 1 ) {
if ( password.empty() )
{
cout << endl;
cout << "Next step is to enter the password to access the other Servers." << endl;
cout << "This is either your password or you can default to using a ssh key" << endl;
cout << "If using a password, the password needs to be the same on all Servers." << endl << endl;
}
while(true)
{
char *pass1, *pass2;
if ( noPrompting ) {
cout << "Enter password, hit 'enter' to default to using a ssh key, or 'exit' > " << endl;
if ( password.empty() )
password = "ssh";
break;
}
//check for command line option password
//if ( !password.empty() )
// break;
pass1=getpass("Enter password, hit 'enter' to default to using a ssh key, or 'exit' > ");
if ( strcmp(pass1, "") == 0 ) {
password = "ssh";
break;
}
string p1 = pass1;
if ( p1 == "exit")
exit(0);
pass2=getpass("Confirm password > ");
string p2 = pass2;
if ( p1 == p2 ) {
password = p2;
break;
}
else
cout << "Password mismatch, please re-enter" << endl;
}
//add single quote for special characters
if ( password != "ssh" )
{
password = "'" + password + "'";
}
} }
int thread_id = 0; int thread_id = 0;
@@ -3173,7 +3229,7 @@ int main(int argc, char *argv[])
if( !pkgCheck(columnstorePackage) ) if( !pkgCheck(columnstorePackage) )
exit(1); exit(1);
if ( password.empty() ) /* if ( password.empty() )
{ {
cout << endl; cout << endl;
cout << "Next step is to enter the password to access the other Servers." << endl; cout << "Next step is to enter the password to access the other Servers." << endl;
@@ -3221,10 +3277,10 @@ int main(int argc, char *argv[])
{ {
password = "'" + password + "'"; password = "'" + password + "'";
} }
*/
checkSystemMySQLPort(mysqlPort, sysConfig, USER, password, childmodulelist, IserverTypeInstall, pmwithum); checkSystemMySQLPort(mysqlPort, sysConfig, USER, password, childmodulelist, IserverTypeInstall, pmwithum);
if ( ( IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM ) || /* if ( ( IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM ) ||
( (IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM) && pmwithum ) ) ( (IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM) && pmwithum ) )
{ {
cout << endl << "===== Running the MariaDB ColumnStore MariaDB ColumnStore setup scripts =====" << endl << endl; cout << endl << "===== Running the MariaDB ColumnStore MariaDB ColumnStore setup scripts =====" << endl << endl;
@@ -3233,7 +3289,7 @@ int main(int argc, char *argv[])
mysqlSetup(); mysqlSetup();
sleep(5); sleep(5);
} }
*/
string AmazonInstall = "0"; string AmazonInstall = "0";
if ( amazonInstall ) if ( amazonInstall )
AmazonInstall = "1"; AmazonInstall = "1";
@@ -3411,7 +3467,7 @@ int main(int argc, char *argv[])
cout << " DONE" << endl; cout << " DONE" << endl;
} }
} }
else /* else
{ {
if ( ( IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM ) || if ( ( IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM ) ||
( (IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM) && pmwithum ) ) ( (IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM) && pmwithum ) )
@@ -3423,7 +3479,7 @@ int main(int argc, char *argv[])
sleep(5); sleep(5);
} }
} }
*/
//configure data redundancy //configure data redundancy
if (DataRedundancy) if (DataRedundancy)
{ {