mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-11 05:17:41 +03:00
Changed error messages, get rid of unneed read_auths
This commit is contained in:
parent
b443aa5547
commit
7013aa927a
@ -84,21 +84,24 @@ int Client::read_oneauth(string &secret, string& error_msg)
|
||||
{
|
||||
struct passwd pw_ent;
|
||||
struct passwd * result;
|
||||
char pwdbuffer[16384];
|
||||
int pwdlinelen = sizeof(pwdbuffer);
|
||||
|
||||
char pwdbuffer[16384];
|
||||
size_t pwdlinelen = sizeof(pwdbuffer);
|
||||
|
||||
rc = getpwuid_r(getuid(), &pw_ent, pwdbuffer, pwdlinelen, &result);
|
||||
|
||||
if (result == NULL)
|
||||
if (result == 0)
|
||||
{
|
||||
if (rc == 0)
|
||||
{
|
||||
error_msg = "Could not get one_auth file location";
|
||||
return -1;
|
||||
} else {
|
||||
error_msg = "one_auth error";
|
||||
return -1;
|
||||
error_msg = "No matching password record for user";
|
||||
}
|
||||
else
|
||||
{
|
||||
error_msg = "Error accessing password file";
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
one_auth_file = pw_ent.pw_dir;
|
||||
|
@ -29,16 +29,9 @@ const time_t FedReplicaManager::xmlrpc_timeout_ms = 10000;
|
||||
|
||||
FedReplicaManager::FedReplicaManager(LogDB * d): ReplicaManager(), logdb(d)
|
||||
{
|
||||
std::string error, xmlrpc_secret;
|
||||
|
||||
pthread_mutex_init(&mutex, 0);
|
||||
|
||||
am.addListener(this);
|
||||
|
||||
if ( Client::read_oneauth(xmlrpc_secret, error) == -1 )
|
||||
{
|
||||
throw runtime_error(error);
|
||||
}
|
||||
};
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
@ -54,18 +54,12 @@ RaftManager::RaftManager(int id, const VectorAttribute * leader_hook_mad,
|
||||
Nebula& nd = Nebula::instance();
|
||||
LogDB * logdb = nd.get_logdb();
|
||||
|
||||
std::string raft_xml, cmd, arg, error;
|
||||
std::string xmlrpc_secret;
|
||||
std::string raft_xml, cmd, arg;
|
||||
|
||||
pthread_mutex_init(&mutex, 0);
|
||||
|
||||
am.addListener(this);
|
||||
|
||||
if ( Client::read_oneauth(xmlrpc_secret, error) == -1 )
|
||||
{
|
||||
throw runtime_error(error);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Initialize Raft variables:
|
||||
// - state
|
||||
|
Loading…
Reference in New Issue
Block a user