#include "Utilities/DavixAdaptor/interface/DavixFile.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Utilities/interface/EDMException.h"
#include "FWCore/Utilities/interface/Exception.h"
#include <cassert>
#include <davix.hpp>
#include <cerrno>
#include <fcntl.h>
#include <cstdlib>
#include <unistd.h>
#include <vector>
#include <mutex>
Go to the source code of this file.
|
static int | X509Authentication (void *userdata, const SessionInfo &info, X509Credential *cert, DavixError **davixErr) |
|
◆ X509Authentication()
static int X509Authentication |
( |
void * |
userdata, |
|
|
const SessionInfo & |
info, |
|
|
X509Credential * |
cert, |
|
|
DavixError ** |
davixErr |
|
) |
| |
|
static |
Definition at line 109 of file DavixFile.cc.
References AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by edm::storage::DavixFile::open().
111 char default_proxy[64];
112 snprintf(default_proxy,
sizeof(default_proxy),
"/tmp/x509up_u%d", geteuid());
114 if (std::getenv(
"X509_USER_PROXY")) {
115 edm::LogInfo(
"DavixFile") <<
"X509_USER_PROXY found in environment." 116 <<
" Will use it for authentication";
117 ucert = ukey = std::getenv(
"X509_USER_PROXY");
120 else if (access(default_proxy, R_OK) == 0) {
121 edm::LogInfo(
"DavixFile") <<
"Found proxy in default location " << default_proxy
122 <<
" Will use it for authentication";
123 ucert = ukey = default_proxy;
126 else if (std::getenv(
"X509_USER_CERT")) {
127 ucert = std::getenv(
"X509_USER_CERT");
130 if (!ucert.empty() && std::getenv(
"X509_USER_KEY")) {
131 edm::LogInfo(
"DavixFile") <<
"X509_USER_{CERT|KEY} found in environment" 132 <<
" Will use it for authentication";
133 ukey = std::getenv(
"X509_USER_KEY");
136 if (ucert.empty() || ukey.empty()) {
137 edm::LogWarning(
"DavixFile") <<
"Was not able to find proxy in $X509_USER_PROXY, " 138 <<
"X509_USER_{CERT|KEY} or default proxy creation location. " 139 <<
"Will try without authentication";
142 return cert->loadFromFilePEM(ukey, ucert,
"", davixErr);
Log< level::Info, false > LogInfo
Log< level::Warning, false > LogWarning
◆ davixDebugInit
std::once_flag davixDebugInit |
|
static |