API
MagAOX::app::MagAOXApp< _useINDI >::elevatedPrivileges Class Reference

Internal class to manage setuid privilege escalation with RAII. More...

#include <MagAOXApp.hpp>

Collaboration diagram for MagAOX::app::MagAOXApp< _useINDI >::elevatedPrivileges:
Collaboration graph

Public Member Functions

 elevatedPrivileges (MagAOXApp *app)
 
void elevate ()
 
void restore ()
 
 ~elevatedPrivileges ()
 

Private Attributes

MagAOXAppm_app
 
bool m_elevated { false }
 

Detailed Description

template<bool _useINDI = true>
class MagAOX::app::MagAOXApp< _useINDI >::elevatedPrivileges

Internal class to manage setuid privilege escalation with RAII.

Upon construction this elevates to the called user id, root in a setuid process. Restores privileges to real user id upon destruction (i.e. when it goes out of scope).

Definition at line 323 of file MagAOXApp.hpp.

Constructor & Destructor Documentation

◆ elevatedPrivileges()

template<bool _useINDI = true>
MagAOX::app::MagAOXApp< _useINDI >::elevatedPrivileges::elevatedPrivileges ( MagAOXApp app)
inlineexplicit

Definition at line 330 of file MagAOXApp.hpp.

◆ ~elevatedPrivileges()

template<bool _useINDI = true>
MagAOX::app::MagAOXApp< _useINDI >::elevatedPrivileges::~elevatedPrivileges ( )
inline

Definition at line 354 of file MagAOXApp.hpp.

Member Function Documentation

◆ elevate()

template<bool _useINDI = true>
void MagAOX::app::MagAOXApp< _useINDI >::elevatedPrivileges::elevate ( )
inline

Definition at line 336 of file MagAOXApp.hpp.

◆ restore()

template<bool _useINDI = true>
void MagAOX::app::MagAOXApp< _useINDI >::elevatedPrivileges::restore ( )
inline

Definition at line 345 of file MagAOXApp.hpp.

Member Data Documentation

◆ m_app

template<bool _useINDI = true>
MagAOXApp* MagAOX::app::MagAOXApp< _useINDI >::elevatedPrivileges::m_app
private

Definition at line 326 of file MagAOXApp.hpp.

◆ m_elevated

template<bool _useINDI = true>
bool MagAOX::app::MagAOXApp< _useINDI >::elevatedPrivileges::m_elevated { false }
private

Definition at line 327 of file MagAOXApp.hpp.


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