ARC SDK
Public Member Functions | Protected Attributes
Arc::CertEnvLocker Class Reference

Class for handling X509* variables in a multi-threaded environment. More...

#include <arc/UserConfig.h>

Public Member Functions

 CertEnvLocker (const UserConfig &cfg)
 Create a lock on X509 environment variables. Blocks if another instance exists. More...
 
 ~CertEnvLocker (void)
 Release lock on X509 environment variables and set back to old values if they were changed. More...
 

Protected Attributes

std::string x509_user_key_old
 
std::string x509_user_key_new
 
bool x509_user_key_set
 
std::string x509_user_cert_old
 
std::string x509_user_cert_new
 
bool x509_user_cert_set
 
std::string x509_user_proxy_old
 
std::string x509_user_proxy_new
 
bool x509_user_proxy_set
 
std::string ca_cert_dir_old
 
bool ca_cert_dir_set
 

Detailed Description

Class for handling X509* variables in a multi-threaded environment.

This class is useful when using external libraries which depend on X509* environment variables in a multi-threaded environment. When an instance of this class is created it holds a lock on these variables until the instance is destroyed. Additionally, if the credentials pointed to by the those variables are owned by a different uid from the uid of the current process, a temporary copy is made owned by the uid of the current process and the X509 variable points there instead. This is to comply with some restrictions in third-party libraries which insist on the credential files being owned by the current uid.

Constructor & Destructor Documentation

◆ CertEnvLocker()

Arc::CertEnvLocker::CertEnvLocker ( const UserConfig cfg)

Create a lock on X509 environment variables. Blocks if another instance exists.

◆ ~CertEnvLocker()

Arc::CertEnvLocker::~CertEnvLocker ( void  )

Release lock on X509 environment variables and set back to old values if they were changed.


The documentation for this class was generated from the following file: