Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verifies readability of key files (when they exist) and aborts startu… #34

Merged
merged 2 commits into from
May 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/S3FileSystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "S3AccessInfo.hh"
#include "S3Directory.hh"
#include "S3File.hh"
#include "shortfile.hh"
#include "stl_string_utils.hh"

#include <XrdOuc/XrdOucEnv.hh>
Expand Down Expand Up @@ -87,6 +88,21 @@ bool S3FileSystem::Config(XrdSysLogger *lp, const char *configfn) {
m_log.Emsg("Config", "s3.region not specified");
return false;
}
std::string contents;
if (newAccessInfo->getS3AccessKeyFile() != "") {
if (!readShortFile(newAccessInfo->getS3AccessKeyFile(),
contents)) {
m_log.Emsg("Config", "s3.access_key_file not readable");
return false;
}
}
if (newAccessInfo->getS3SecretKeyFile() != "") {
if (!readShortFile(newAccessInfo->getS3SecretKeyFile(),
contents)) {
m_log.Emsg("Config", "s3.secret_key_file not readable");
return false;
}
}
newAccessInfo = new S3AccessInfo();
exposedPath = "";
continue;
Expand Down
Loading