library/src/blockclass/subclasses/BPSC_SSHIntegrityChecker.cc
// attempts to switch user (su) on current host and expect a prompt
attempts to switch user (su) on current host and expect a prompt
attempts to switch user ( su ) on current host and expect a prompt
size_t BPSC_SSHIntegrityChecker::doSu(char *user, char *pass, char *su_expect_prompt) {
	if (!pass || !su_expect_prompt) {
		this->AddErrorToStack("Error in BPSC_SSHIntegrityChecker::doSu(): bad parameters to function.");
		return ERR_FAILURE;
	}
	this->ccAddTryExcept("su", this->su_path, bpstrlen(this->su_path), ":", 1);
	this->ccAddTryExcept("su", pass, bpstrlen(pass), su_expect_prompt, bpstrlen(su_expect_prompt));
	return this->ccExecuteCommand("su", NULL);
}
size_t BPSC_SSHIntegrityChecker :: doSu ( char * user , char * pass , char * su_expect_prompt ) { if ( ! pass || ! su_expect_prompt ) { this -> AddErrorToStack ( " " ) ; return ERR_FAILURE ; } this -> ccAddTryExcept ( " " , this -> su_path , bpstrlen ( this -> su_path ) , " " , 1 ) ; this -> ccAddTryExcept ( " " , pass , bpstrlen ( pass ) , su_expect_prompt , bpstrlen ( su_expect_prompt ) ) ; return this -> ccExecuteCommand ( " " , NULL ) ; }
attempts to switch user (su) on current host and expect a prompt
attempts to switch user ( su ) on current host and expect a prompt
// add try/except for sudo // execute the command on the remote host