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