Commit 6c83bea6 authored by Cedric Caffy's avatar Cedric Caffy
Browse files

[cta-admin dr ls] added xrdsecprotocol and xrdsecssskt values in the output of dr ls

parent f56f6895
......@@ -984,5 +984,13 @@ std::string removePrefix(const std::string& input, char prefixChar){
}
}
std::string getEnv(const std::string& variableName){
const char * envVarC = std::getenv(variableName.c_str());
if(envVarC == NULL){
return "";
}
return std::string(envVarC);
}
} // namespace utils
} // namespace cta
......@@ -471,6 +471,14 @@ namespace utils {
*/
std::string removePrefix(const std::string & input, char prefixChar);
/**
* Returns the value of the environment variable passed in parameter
* @param variableName the name of the environment variable to be passed
* @return the value of the environment variable passed in parameter
* If the environment variable is not set, it will return an empty string
*/
std::string getEnv(const std::string & variableName);
} // namespace utils
} // namespace cta
......@@ -287,6 +287,8 @@ void DriveState::setConfig(const cta::tape::daemon::TapedConfiguration& tapedCon
fillConfig(config->wdIdleSessionTimer);
fillConfig(config->backendPath);
fillConfig(config->fileCatalogConfigFile);
fillConfig(config->authenticationProtocol);
fillConfig(config->authenticationSSSKeytab);
}
//------------------------------------------------------------------------------
......
......@@ -1157,8 +1157,8 @@ uint64_t Scheduler::getNbFilesAlreadyArchived(const common::dataStructures::Arch
void Scheduler::checkNeededEnvironmentVariables(){
std::set<std::string> environmentVariablesNotSet;
for(auto & environmentVariable: c_mandatoryEnvironmentVariables){
const char * envVarC = std::getenv(environmentVariable.c_str());
if(envVarC == NULL){
std::string envVar = cta::utils::getEnv(environmentVariable);
if(envVar.empty()){
environmentVariablesNotSet.insert(environmentVariable);
}
}
......
......@@ -118,7 +118,7 @@ static int exceptionThrowingMain(
std::list<cta::log::Param> params = {cta::log::Param("logMask", globalConfig.logMask.value())};
log(log::INFO, "Set log mask", params);
}
// Create the object providing utilities for working with UNIX capabilities
cta::server::ProcessCap capUtils;
......
......@@ -119,6 +119,9 @@ TapedConfiguration TapedConfiguration::createFromCtaConf(
// Extract drive list from tpconfig + parsed config file
ret.driveConfigs = Tpconfig::parseFile(ret.tpConfigPath.value());
ret.authenticationProtocol.set(cta::utils::getEnv("XrdSecPROTOCOL"),"Environment variable");
ret.authenticationSSSKeytab.set(cta::utils::getEnv("XrdSecSSSKT"),"Environment variable");
// If we get here, the configuration file is good enough to be logged.
ret.daemonUserName.log(log);
ret.daemonGroupName.log(log);
......
......@@ -120,6 +120,16 @@ struct TapedConfiguration {
/// Path to the file catalog config file
cta::SourcedParameter<std::string> fileCatalogConfigFile{
"general", "FileCatalogConfigFile", "/etc/cta/cta-catalogue.conf", "Compile time default"};
//----------------------------------------------------------------------------
// The authentication configuration
//----------------------------------------------------------------------------
/// The authentication protocol
cta::SourcedParameter<std::string> authenticationProtocol{
"environment", "XrdSecPROTOCOL"};
/// The authentication protocol
cta::SourcedParameter<std::string> authenticationSSSKeytab{
"environment", "XrdSecSSSKT"};
private:
/** A private dummy logger which will simplify the implementation of the
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment