![]() |
libfilezilla
|
Impersonation tokens for a given user can be used to spawn processes running as that user. More...
#include <impersonation.hpp>
Public Member Functions | |
| impersonation_token (impersonation_token &&) noexcept | |
| impersonation_token & | operator= (impersonation_token &&) noexcept |
| impersonation_token (fz::user const &user, fz::native_string const &password, fz::logger_interface &logger=get_null_logger(), impersonation_options const &opts={}) | |
| Creates an impersonation token, verifying credentials in the process. | |
| impersonation_token (fz::user const &user, impersonation_options::pwless_type, fz::logger_interface &logger=get_null_logger(), impersonation_options const &opts={}) | |
| operator bool () const | |
| bool | operator== (impersonation_token const &) const |
| bool | operator< (impersonation_token const &) const |
| fz::native_string | username () const |
| Returns the name of the impersonated user. | |
| fz::native_string | home () const |
| Returns home directory, may be empty. | |
| std::size_t | hash () const noexcept |
| For std::hash. | |
| std::string | uid () const |
| A opaque unique identifier. | |
Static Public Member Functions | |
| static impersonation_capabilities | get_capabilities (std::initializer_list< impersonation_capability > requested) |
Friends | |
| class | impersonation_token_impl |
Impersonation tokens for a given user can be used to spawn processes running as that user.
Platform-specific prerequisites are documented by impersonation_capability. On Windows, the required user rights can be configured through secpol.msc under Local Policies -> User Rights Assignment.
Use get_capabilities() to query the process-wide prerequisites that can be determined in advance. User-specific operations can still fail when a token is created or used.
|
static |
Returns the availability of the requested impersonation capabilities. Unrequested capabilities are returned as impersonation_capability_state::not_requested.