#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) |
|
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 DavixFile::open().
112 char default_proxy[64];
113 snprintf(default_proxy,
sizeof(default_proxy),
"/tmp/x509up_u%d", geteuid());
115 if (getenv(
"X509_USER_PROXY")) {
116 edm::LogInfo(
"DavixFile") <<
"X509_USER_PROXY found in environment." 117 <<
" Will use it for authentication";
118 ucert = ukey = getenv(
"X509_USER_PROXY");
121 else if (access(default_proxy, R_OK) == 0) {
122 edm::LogInfo(
"DavixFile") <<
"Found proxy in default location " << default_proxy
123 <<
" Will use it for authentication";
124 ucert = ukey = default_proxy;
127 else if (getenv(
"X509_USER_CERT")) {
128 ucert = getenv(
"X509_USER_CERT");
131 if (!ucert.empty() && getenv(
"X509_USER_KEY")) {
132 edm::LogInfo(
"DavixFile") <<
"X509_USER_{CERT|KEY} found in environment" 133 <<
" Will use it for authentication";
134 ukey = getenv(
"X509_USER_KEY");
137 if (ucert.empty() || ukey.empty()) {
138 edm::LogWarning(
"DavixFile") <<
"Was not able to find proxy in $X509_USER_PROXY, " 139 <<
"X509_USER_{CERT|KEY} or default proxy creation location. " 140 <<
"Will try without authentication";
143 return cert->loadFromFilePEM(ukey, ucert,
"", davixErr);
std::once_flag davixDebugInit |
|
static |