Skip to content

Commit

Permalink
Merge pull request #34 from rw2/key-permissions
Browse files Browse the repository at this point in the history
verifies readability of key files (when they exist) and aborts startu…
  • Loading branch information
jhiemstrawisc authored May 24, 2024
2 parents c829527 + 00d9a88 commit f5b66a3
Showing 1 changed file with 16 additions and 0 deletions.
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

0 comments on commit f5b66a3

Please sign in to comment.