#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 107 of file DavixFile.cc.
References AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by DavixFile::open().
110 char default_proxy[64];
111 snprintf(default_proxy,
sizeof(default_proxy),
"/tmp/x509up_u%d", geteuid());
113 if (getenv(
"X509_USER_PROXY")) {
114 edm::LogInfo(
"DavixFile") <<
"X509_USER_PROXY found in environment." 115 <<
" Will use it for authentication";
116 ucert = ukey = getenv(
"X509_USER_PROXY");
119 else if (access(default_proxy, R_OK) == 0) {
120 edm::LogInfo(
"DavixFile") <<
"Found proxy in default location " << default_proxy
121 <<
" Will use it for authentication";
122 ucert = ukey = default_proxy;
125 else if (getenv(
"X509_USER_CERT")) {
126 ucert = getenv(
"X509_USER_CERT");
129 if (!ucert.empty() && getenv(
"X509_USER_KEY")) {
130 edm::LogInfo(
"DavixFile") <<
"X509_USER_{CERT|KEY} found in environment" 131 <<
" Will use it for authentication";
132 ukey = getenv(
"X509_USER_KEY");
135 if (ucert.empty() || ukey.empty()) {
136 edm::LogWarning(
"DavixFile") <<
"Was not able to find proxy in $X509_USER_PROXY, " 137 <<
"X509_USER_{CERT|KEY} or default proxy creation location. " 138 <<
"Will try without authentication";
141 return cert->loadFromFilePEM(ukey, ucert,
"", davixErr);
std::once_flag davixDebugInit |
|
static |