sss_idmap
1.16.1
|
Libsss_idmap provides a mechanism to translate a SID to a UNIX UID or GID or the other way round. More...
Data Structures | |
struct | sss_idmap_range |
Structure for id ranges FIXME: this struct might change when it is clear how ranges are handled on the server side. More... | |
Typedefs | |
typedef void *() | idmap_alloc_func(size_t size, void *pvt) |
Typedef for memory allocation functions. | |
typedef enum idmap_error_code(* | idmap_store_cb) (const char *dom_name, const char *dom_sid, const char *range_id, uint32_t min_id, uint32_t max_id, uint32_t first_rid, void *pvt) |
Typedef for storing mappings of dynamically created domains. | |
Enumerations | |
enum | idmap_error_code { IDMAP_SUCCESS = 0, IDMAP_NOT_IMPLEMENTED, IDMAP_ERROR, IDMAP_OUT_OF_MEMORY, IDMAP_NO_DOMAIN, IDMAP_CONTEXT_INVALID, IDMAP_SID_INVALID, IDMAP_SID_UNKNOWN, IDMAP_NO_RANGE, IDMAP_BUILTIN_SID, IDMAP_OUT_OF_SLICES, IDMAP_COLLISION, IDMAP_EXTERNAL, IDMAP_NAME_UNKNOWN, IDMAP_ERR_LAST } |
Error codes used by libsss_idmap. More... | |
Functions | |
enum idmap_error_code | sss_idmap_init (idmap_alloc_func *alloc_func, void *alloc_pvt, idmap_free_func *free_func, struct sss_idmap_ctx **ctx) |
Initialize idmap context. More... | |
enum idmap_error_code | sss_idmap_ctx_set_autorid (struct sss_idmap_ctx *ctx, bool use_autorid) |
Set/unset autorid compatibility mode. More... | |
enum idmap_error_code | sss_idmap_ctx_set_lower (struct sss_idmap_ctx *ctx, id_t lower) |
Set the lower bound of the range of POSIX IDs. More... | |
enum idmap_error_code | sss_idmap_ctx_set_upper (struct sss_idmap_ctx *ctx, id_t upper) |
Set the upper bound of the range of POSIX IDs. More... | |
enum idmap_error_code | sss_idmap_ctx_set_rangesize (struct sss_idmap_ctx *ctx, id_t rangesize) |
Set the range size of POSIX IDs available for single domain. More... | |
enum idmap_error_code | sss_idmap_ctx_set_extra_slice_init (struct sss_idmap_ctx *ctx, int extra_slice_init) |
Set the number of secondary slices available for domain. More... | |
enum idmap_error_code | sss_idmap_ctx_get_autorid (struct sss_idmap_ctx *ctx, bool *_autorid) |
Check if autorid compatibility mode is set. More... | |
enum idmap_error_code | sss_idmap_ctx_get_lower (struct sss_idmap_ctx *ctx, id_t *_lower) |
Get the lower bound of the range of POSIX IDs. More... | |
enum idmap_error_code | sss_idmap_ctx_get_upper (struct sss_idmap_ctx *ctx, id_t *_upper) |
Get the upper bound of the range of POSIX IDs. More... | |
enum idmap_error_code | sss_idmap_ctx_get_rangesize (struct sss_idmap_ctx *ctx, id_t *rangesize) |
Get the range size of POSIX IDs available for single domain. More... | |
enum idmap_error_code | sss_idmap_calculate_range (struct sss_idmap_ctx *ctx, const char *dom_sid, id_t *slice_num, struct sss_idmap_range *range) |
Calculate new range of available POSIX IDs. More... | |
enum idmap_error_code | sss_idmap_add_domain (struct sss_idmap_ctx *ctx, const char *domain_name, const char *domain_sid, struct sss_idmap_range *range) |
Add a domain to the idmap context. More... | |
enum idmap_error_code | sss_idmap_add_domain_ex (struct sss_idmap_ctx *ctx, const char *domain_name, const char *domain_sid, struct sss_idmap_range *range, const char *range_id, uint32_t rid, bool external_mapping) |
Add a domain with the first mappable RID to the idmap context. More... | |
enum idmap_error_code | sss_idmap_add_auto_domain_ex (struct sss_idmap_ctx *ctx, const char *domain_name, const char *domain_sid, struct sss_idmap_range *range, const char *range_id, uint32_t rid, bool external_mapping, idmap_store_cb cb, void *pvt) |
Add a domain with the first mappable RID to the idmap context and generate automatically secondary slices. More... | |
enum idmap_error_code | sss_idmap_check_collision (struct sss_idmap_ctx *ctx, char *n_name, char *n_sid, struct sss_idmap_range *n_range, uint32_t n_first_rid, char *n_range_id, bool n_external_mapping) |
Check if a new range would collide with any existing one. More... | |
enum idmap_error_code | sss_idmap_check_collision_ex (const char *o_name, const char *o_sid, struct sss_idmap_range *o_range, uint32_t o_first_rid, const char *o_range_id, bool o_external_mapping, const char *n_name, const char *n_sid, struct sss_idmap_range *n_range, uint32_t n_first_rid, const char *n_range_id, bool n_external_mapping) |
Check if two ranges would collide. More... | |
enum idmap_error_code | sss_idmap_sid_to_unix (struct sss_idmap_ctx *ctx, const char *sid, uint32_t *id) |
Translate SID to a unix UID or GID. More... | |
enum idmap_error_code | sss_idmap_dom_sid_to_unix (struct sss_idmap_ctx *ctx, struct sss_dom_sid *dom_sid, uint32_t *id) |
Translate a SID stucture to a unix UID or GID. More... | |
enum idmap_error_code | sss_idmap_bin_sid_to_unix (struct sss_idmap_ctx *ctx, uint8_t *bin_sid, size_t length, uint32_t *id) |
Translate a binary SID to a unix UID or GID. More... | |
enum idmap_error_code | sss_idmap_smb_sid_to_unix (struct sss_idmap_ctx *ctx, struct dom_sid *smb_sid, uint32_t *id) |
Translate a Samba dom_sid stucture to a unix UID or GID. More... | |
enum idmap_error_code | sss_idmap_check_sid_unix (struct sss_idmap_ctx *ctx, const char *sid, uint32_t id) |
Check if a SID and a unix UID or GID belong to the same range. More... | |
enum idmap_error_code | sss_idmap_check_dom_sid_unix (struct sss_idmap_ctx *ctx, struct sss_dom_sid *dom_sid, uint32_t id) |
Check if a SID structure and a unix UID or GID belong to the same range. More... | |
enum idmap_error_code | sss_idmap_check_bin_sid_unix (struct sss_idmap_ctx *ctx, uint8_t *bin_sid, size_t length, uint32_t id) |
Check if a binary SID and a unix UID or GID belong to the same range. More... | |
enum idmap_error_code | sss_idmap_check_smb_sid_unix (struct sss_idmap_ctx *ctx, struct dom_sid *smb_sid, uint32_t id) |
Check if a Samba dom_sid structure and a unix UID or GID belong to the same range. More... | |
enum idmap_error_code | sss_idmap_unix_to_sid (struct sss_idmap_ctx *ctx, uint32_t id, char **sid) |
Translate unix UID or GID to a SID. More... | |
enum idmap_error_code | sss_idmap_unix_to_dom_sid (struct sss_idmap_ctx *ctx, uint32_t id, struct sss_dom_sid **dom_sid) |
Translate unix UID or GID to a SID structure. More... | |
enum idmap_error_code | sss_idmap_unix_to_bin_sid (struct sss_idmap_ctx *ctx, uint32_t id, uint8_t **bin_sid, size_t *length) |
Translate unix UID or GID to a binary SID. More... | |
enum idmap_error_code | sss_idmap_free (struct sss_idmap_ctx *ctx) |
Free all the allocated memory of the idmap context. More... | |
enum idmap_error_code | sss_idmap_free_sid (struct sss_idmap_ctx *ctx, char *sid) |
Free mapped SID. More... | |
enum idmap_error_code | sss_idmap_free_dom_sid (struct sss_idmap_ctx *ctx, struct sss_dom_sid *dom_sid) |
Free mapped domain SID. More... | |
enum idmap_error_code | sss_idmap_free_smb_sid (struct sss_idmap_ctx *ctx, struct dom_sid *smb_sid) |
Free mapped Samba SID. More... | |
enum idmap_error_code | sss_idmap_free_bin_sid (struct sss_idmap_ctx *ctx, uint8_t *bin_sid) |
Free mapped binary SID. More... | |
const char * | idmap_error_string (enum idmap_error_code err) |
Translate error code to a string. More... | |
bool | is_domain_sid (const char *str) |
Check if given string can be used as domain SID. More... | |
enum idmap_error_code | sss_idmap_domain_has_algorithmic_mapping (struct sss_idmap_ctx *ctx, const char *dom_sid, bool *has_algorithmic_mapping) |
Check if a domain is configured with algorithmic mapping. More... | |
enum idmap_error_code | sss_idmap_domain_by_name_has_algorithmic_mapping (struct sss_idmap_ctx *ctx, const char *dom_name, bool *has_algorithmic_mapping) |
Check if a domain is configured with algorithmic mapping. More... | |
enum idmap_error_code | sss_idmap_bin_sid_to_dom_sid (struct sss_idmap_ctx *ctx, const uint8_t *bin_sid, size_t length, struct sss_dom_sid **dom_sid) |
Convert binary SID to SID structure. More... | |
enum idmap_error_code | sss_idmap_bin_sid_to_sid (struct sss_idmap_ctx *ctx, const uint8_t *bin_sid, size_t length, char **sid) |
Convert binary SID to SID string. More... | |
enum idmap_error_code | sss_idmap_dom_sid_to_bin_sid (struct sss_idmap_ctx *ctx, struct sss_dom_sid *dom_sid, uint8_t **bin_sid, size_t *length) |
Convert SID structure to binary SID. More... | |
enum idmap_error_code | sss_idmap_sid_to_bin_sid (struct sss_idmap_ctx *ctx, const char *sid, uint8_t **bin_sid, size_t *length) |
Convert SID string to binary SID. More... | |
enum idmap_error_code | sss_idmap_dom_sid_to_sid (struct sss_idmap_ctx *ctx, struct sss_dom_sid *dom_sid, char **sid) |
Convert SID structure to SID string. More... | |
enum idmap_error_code | sss_idmap_sid_to_dom_sid (struct sss_idmap_ctx *ctx, const char *sid, struct sss_dom_sid **dom_sid) |
Convert SID string to SID structure. More... | |
enum idmap_error_code | sss_idmap_sid_to_smb_sid (struct sss_idmap_ctx *ctx, const char *sid, struct dom_sid **smb_sid) |
Convert SID string to Samba dom_sid structure. More... | |
enum idmap_error_code | sss_idmap_smb_sid_to_sid (struct sss_idmap_ctx *ctx, struct dom_sid *smb_sid, char **sid) |
Convert Samba dom_sid structure to SID string. More... | |
enum idmap_error_code | sss_idmap_dom_sid_to_smb_sid (struct sss_idmap_ctx *ctx, struct sss_dom_sid *dom_sid, struct dom_sid **smb_sid) |
Convert SID stucture to Samba dom_sid structure. More... | |
enum idmap_error_code | sss_idmap_smb_sid_to_dom_sid (struct sss_idmap_ctx *ctx, struct dom_sid *smb_sid, struct sss_dom_sid **dom_sid) |
Convert Samba dom_sid structure to SID structure. More... | |
enum idmap_error_code | sss_idmap_bin_sid_to_smb_sid (struct sss_idmap_ctx *ctx, const uint8_t *bin_sid, size_t length, struct dom_sid **smb_sid) |
Convert binary SID to Samba dom_sid structure. More... | |
enum idmap_error_code | sss_idmap_smb_sid_to_bin_sid (struct sss_idmap_ctx *ctx, struct dom_sid *smb_sid, uint8_t **bin_sid, size_t *length) |
Convert Samba dom_sid structure to binary SID. More... | |
Libsss_idmap provides a mechanism to translate a SID to a UNIX UID or GID or the other way round.
enum idmap_error_code |
Error codes used by libsss_idmap.
const char* idmap_error_string | ( | enum idmap_error_code | err | ) |
Translate error code to a string.
[in] | err | Idmap error code |
bool is_domain_sid | ( | const char * | str | ) |
Check if given string can be used as domain SID.
[in] | str | String to check |
enum idmap_error_code sss_idmap_add_auto_domain_ex | ( | struct sss_idmap_ctx * | ctx, |
const char * | domain_name, | ||
const char * | domain_sid, | ||
struct sss_idmap_range * | range, | ||
const char * | range_id, | ||
uint32_t | rid, | ||
bool | external_mapping, | ||
idmap_store_cb | cb, | ||
void * | pvt | ||
) |
Add a domain with the first mappable RID to the idmap context and generate automatically secondary slices.
[in] | ctx | Idmap context |
[in] | domain_name | Zero-terminated string with the domain name |
[in] | domain_sid | Zero-terminated string representation of the domain SID (S-1-15-.....) |
[in] | range | TBD Some information about the id ranges of this domain |
[in] | range_id | optional unique identifier of a range, it is needed to allow updates at runtime |
[in] | rid | The RID that should be mapped to the first ID of the given range. |
[in] | external_mapping | If set to true the ID will not be mapped algorithmically, but the *_to_unix and *_unix_to_* calls will return IDMAP_EXTERNAL to instruct the caller to check external sources. For a single domain all ranges must be of the same type. It is not possible to mix algorithmic and external mapping. |
[in] | cb | The callback for storing mapping of dynamically created domains. |
[in] | pvt | Private data for callback cb. |
enum idmap_error_code sss_idmap_add_domain | ( | struct sss_idmap_ctx * | ctx, |
const char * | domain_name, | ||
const char * | domain_sid, | ||
struct sss_idmap_range * | range | ||
) |
Add a domain to the idmap context.
[in] | ctx | Idmap context |
[in] | domain_name | Zero-terminated string with the domain name |
[in] | domain_sid | Zero-terminated string representation of the domain SID (S-1-15-.....) |
[in] | range | TBD Some information about the id ranges of this domain |
enum idmap_error_code sss_idmap_add_domain_ex | ( | struct sss_idmap_ctx * | ctx, |
const char * | domain_name, | ||
const char * | domain_sid, | ||
struct sss_idmap_range * | range, | ||
const char * | range_id, | ||
uint32_t | rid, | ||
bool | external_mapping | ||
) |
Add a domain with the first mappable RID to the idmap context.
[in] | ctx | Idmap context |
[in] | domain_name | Zero-terminated string with the domain name |
[in] | domain_sid | Zero-terminated string representation of the domain SID (S-1-15-.....) |
[in] | range | TBD Some information about the id ranges of this domain |
[in] | range_id | optional unique identifier of a range, it is needed to allow updates at runtime |
[in] | rid | The RID that should be mapped to the first ID of the given range. |
[in] | external_mapping | If set to true the ID will not be mapped algorithmically, but the *_to_unix and *_unix_to_* calls will return IDMAP_EXTERNAL to instruct the caller to check external sources. For a single domain all ranges must be of the same type. It is not possible to mix algorithmic and external mapping. |
enum idmap_error_code sss_idmap_bin_sid_to_dom_sid | ( | struct sss_idmap_ctx * | ctx, |
const uint8_t * | bin_sid, | ||
size_t | length, | ||
struct sss_dom_sid ** | dom_sid | ||
) |
Convert binary SID to SID structure.
[in] | ctx | Idmap context |
[in] | bin_sid | Array with the binary SID |
[in] | length | Size of the array containing the binary SID |
[out] | dom_sid | SID structure, must be freed if not needed anymore |
enum idmap_error_code sss_idmap_bin_sid_to_sid | ( | struct sss_idmap_ctx * | ctx, |
const uint8_t * | bin_sid, | ||
size_t | length, | ||
char ** | sid | ||
) |
Convert binary SID to SID string.
[in] | ctx | Idmap context |
[in] | bin_sid | Array with the binary SID |
[in] | length | Size of the array containing the binary SID |
[out] | sid | Zero-terminated string representation of the SID, must be freed if not needed anymore |
enum idmap_error_code sss_idmap_bin_sid_to_smb_sid | ( | struct sss_idmap_ctx * | ctx, |
const uint8_t * | bin_sid, | ||
size_t | length, | ||
struct dom_sid ** | smb_sid | ||
) |
Convert binary SID to Samba dom_sid structure.
[in] | ctx | Idmap context |
[in] | bin_sid | Array with the binary SID |
[in] | length | Size of the array containing the binary SID |
[out] | smb_sid | Samba dom_sid structure, must be freed if not needed anymore |
enum idmap_error_code sss_idmap_bin_sid_to_unix | ( | struct sss_idmap_ctx * | ctx, |
uint8_t * | bin_sid, | ||
size_t | length, | ||
uint32_t * | id | ||
) |
Translate a binary SID to a unix UID or GID.
[in] | ctx | Idmap context |
[in] | bin_sid | Array with the binary SID |
[in] | length | Size of the array containing the binary SID |
[out] | id | Returned unix UID or GID |
enum idmap_error_code sss_idmap_calculate_range | ( | struct sss_idmap_ctx * | ctx, |
const char * | dom_sid, | ||
id_t * | slice_num, | ||
struct sss_idmap_range * | range | ||
) |
Calculate new range of available POSIX IDs.
[in] | ctx | Idmap context |
[in] | dom_sid | Zero-terminated string representation of the domain SID (S-1-15-.....) |
[in,out] | slice_num | Slice number to be used. Set this pointer to NULL or the addressed value to -1 to calculate slice number automatically. The calculated value will be returned in this parameter. |
[out] | range | Structure containing upper and lower bound of the range of POSIX IDs |
enum idmap_error_code sss_idmap_check_bin_sid_unix | ( | struct sss_idmap_ctx * | ctx, |
uint8_t * | bin_sid, | ||
size_t | length, | ||
uint32_t | id | ||
) |
Check if a binary SID and a unix UID or GID belong to the same range.
[in] | ctx | Idmap context |
[in] | bin_sid | Array with the binary SID |
[in] | length | Size of the array containing the binary SID |
[in] | id | Unix UID or GID |
enum idmap_error_code sss_idmap_check_collision | ( | struct sss_idmap_ctx * | ctx, |
char * | n_name, | ||
char * | n_sid, | ||
struct sss_idmap_range * | n_range, | ||
uint32_t | n_first_rid, | ||
char * | n_range_id, | ||
bool | n_external_mapping | ||
) |
Check if a new range would collide with any existing one.
[in] | ctx | Idmap context |
[in] | n_name | Zero-terminated string with the domain name the new range should belong to |
[in] | n_sid | Zero-terminated string representation of the domain SID (S-1-15-.....) the new range sould belong to |
[in] | n_range | The new id range |
[in] | n_range_id | unique identifier of the new range, it is needed to allow updates at runtime, may be NULL |
[in] | n_first_rid | The RID that should be mapped to the first ID of the new range. |
[in] | n_external_mapping | Mapping type of the new range |
enum idmap_error_code sss_idmap_check_collision_ex | ( | const char * | o_name, |
const char * | o_sid, | ||
struct sss_idmap_range * | o_range, | ||
uint32_t | o_first_rid, | ||
const char * | o_range_id, | ||
bool | o_external_mapping, | ||
const char * | n_name, | ||
const char * | n_sid, | ||
struct sss_idmap_range * | n_range, | ||
uint32_t | n_first_rid, | ||
const char * | n_range_id, | ||
bool | n_external_mapping | ||
) |
Check if two ranges would collide.
[in] | o_name | Zero-terminated string with the domain name the first range should belong to |
[in] | o_sid | Zero-terminated string representation of the domain SID (S-1-15-.....) the first range sould belong to |
[in] | o_range | The first id range |
[in] | o_range_id | unique identifier of the first range, it is needed to allow updates at runtime, may be NULL |
[in] | o_first_rid | The RID that should be mapped to the first ID of the first range. |
[in] | o_external_mapping | Mapping type of the first range |
[in] | n_name | Zero-terminated string with the domain name the second range should belong to |
[in] | n_sid | Zero-terminated string representation of the domain SID (S-1-15-.....) the second range sould belong to |
[in] | n_range | The second id range |
[in] | n_range_id | unique identifier of the second range, it is needed to allow updates at runtime, may be NULL |
[in] | n_first_rid | The RID that should be mapped to the first ID of the second range. |
[in] | n_external_mapping | Mapping type of the second range |
enum idmap_error_code sss_idmap_check_dom_sid_unix | ( | struct sss_idmap_ctx * | ctx, |
struct sss_dom_sid * | dom_sid, | ||
uint32_t | id | ||
) |
Check if a SID structure and a unix UID or GID belong to the same range.
[in] | ctx | Idmap context |
[in] | dom_sid | SID structure |
[in] | id | Unix UID or GID |
enum idmap_error_code sss_idmap_check_sid_unix | ( | struct sss_idmap_ctx * | ctx, |
const char * | sid, | ||
uint32_t | id | ||
) |
Check if a SID and a unix UID or GID belong to the same range.
[in] | ctx | Idmap context |
[in] | sid | Zero-terminated string representation of the SID |
[in] | id | Unix UID or GID |
enum idmap_error_code sss_idmap_check_smb_sid_unix | ( | struct sss_idmap_ctx * | ctx, |
struct dom_sid * | smb_sid, | ||
uint32_t | id | ||
) |
Check if a Samba dom_sid structure and a unix UID or GID belong to the same range.
[in] | ctx | Idmap context |
[in] | smb_sid | Samba dom_sid structure |
[in] | id | Unix UID or GID |
enum idmap_error_code sss_idmap_ctx_get_autorid | ( | struct sss_idmap_ctx * | ctx, |
bool * | _autorid | ||
) |
Check if autorid compatibility mode is set.
[in] | ctx | idmap context |
[out] | _autorid | true if autorid is used |
enum idmap_error_code sss_idmap_ctx_get_lower | ( | struct sss_idmap_ctx * | ctx, |
id_t * | _lower | ||
) |
Get the lower bound of the range of POSIX IDs.
[in] | ctx | idmap context |
[out] | _lower | returned lower bound |
enum idmap_error_code sss_idmap_ctx_get_rangesize | ( | struct sss_idmap_ctx * | ctx, |
id_t * | rangesize | ||
) |
Get the range size of POSIX IDs available for single domain.
[in] | ctx | idmap context |
[out] | rangesize | returned range size |
enum idmap_error_code sss_idmap_ctx_get_upper | ( | struct sss_idmap_ctx * | ctx, |
id_t * | _upper | ||
) |
Get the upper bound of the range of POSIX IDs.
[in] | ctx | idmap context |
[out] | _upper | returned upper bound |
enum idmap_error_code sss_idmap_ctx_set_autorid | ( | struct sss_idmap_ctx * | ctx, |
bool | use_autorid | ||
) |
Set/unset autorid compatibility mode.
[in] | ctx | idmap context |
[in] | use_autorid | If true, autorid compatibility mode will be used |
enum idmap_error_code sss_idmap_ctx_set_extra_slice_init | ( | struct sss_idmap_ctx * | ctx, |
int | extra_slice_init | ||
) |
Set the number of secondary slices available for domain.
[in] | ctx | idmap context |
[in] | extra_slice_init | number of secondary slices to be generated at startup |
enum idmap_error_code sss_idmap_ctx_set_lower | ( | struct sss_idmap_ctx * | ctx, |
id_t | lower | ||
) |
Set the lower bound of the range of POSIX IDs.
[in] | ctx | idmap context |
[in] | lower | lower bound of the range |
enum idmap_error_code sss_idmap_ctx_set_rangesize | ( | struct sss_idmap_ctx * | ctx, |
id_t | rangesize | ||
) |
Set the range size of POSIX IDs available for single domain.
[in] | ctx | idmap context |
[in] | rangesize | range size of IDs |
enum idmap_error_code sss_idmap_ctx_set_upper | ( | struct sss_idmap_ctx * | ctx, |
id_t | upper | ||
) |
Set the upper bound of the range of POSIX IDs.
[in] | ctx | idmap context |
[in] | upper | upper bound of the range |
enum idmap_error_code sss_idmap_dom_sid_to_bin_sid | ( | struct sss_idmap_ctx * | ctx, |
struct sss_dom_sid * | dom_sid, | ||
uint8_t ** | bin_sid, | ||
size_t * | length | ||
) |
Convert SID structure to binary SID.
[in] | ctx | Idmap context |
[in] | dom_sid | SID structure |
[out] | bin_sid | Array with the binary SID, must be freed if not needed anymore |
[out] | length | Size of the array containing the binary SID |
enum idmap_error_code sss_idmap_dom_sid_to_sid | ( | struct sss_idmap_ctx * | ctx, |
struct sss_dom_sid * | dom_sid, | ||
char ** | sid | ||
) |
Convert SID structure to SID string.
[in] | ctx | Idmap context |
[in] | dom_sid | SID structure |
[out] | sid | Zero-terminated string representation of the SID, must be freed if not needed anymore |
enum idmap_error_code sss_idmap_dom_sid_to_smb_sid | ( | struct sss_idmap_ctx * | ctx, |
struct sss_dom_sid * | dom_sid, | ||
struct dom_sid ** | smb_sid | ||
) |
Convert SID stucture to Samba dom_sid structure.
[in] | ctx | Idmap context |
[in] | dom_sid | SID structure |
[out] | smb_sid | Samba dom_sid structure, must be freed if not needed anymore |
enum idmap_error_code sss_idmap_dom_sid_to_unix | ( | struct sss_idmap_ctx * | ctx, |
struct sss_dom_sid * | dom_sid, | ||
uint32_t * | id | ||
) |
Translate a SID stucture to a unix UID or GID.
[in] | ctx | Idmap context |
[in] | dom_sid | SID structure |
[out] | id | Returned unix UID or GID |
enum idmap_error_code sss_idmap_domain_by_name_has_algorithmic_mapping | ( | struct sss_idmap_ctx * | ctx, |
const char * | dom_name, | ||
bool * | has_algorithmic_mapping | ||
) |
Check if a domain is configured with algorithmic mapping.
[in] | ctx | Idmap context |
[in] | dom_name | Name of the domain |
[out] | has_algorithmic_mapping | Boolean value indicating if the given domain is configured for algorithmic mapping or not. |
enum idmap_error_code sss_idmap_domain_has_algorithmic_mapping | ( | struct sss_idmap_ctx * | ctx, |
const char * | dom_sid, | ||
bool * | has_algorithmic_mapping | ||
) |
Check if a domain is configured with algorithmic mapping.
[in] | ctx | Idmap context |
[in] | dom_sid | SID string, can be either a domain SID or an object SID |
[out] | has_algorithmic_mapping | Boolean value indicating if the given domain is configured for algorithmic mapping or not. |
enum idmap_error_code sss_idmap_free | ( | struct sss_idmap_ctx * | ctx | ) |
Free all the allocated memory of the idmap context.
[in] | ctx | Idmap context |
enum idmap_error_code sss_idmap_free_bin_sid | ( | struct sss_idmap_ctx * | ctx, |
uint8_t * | bin_sid | ||
) |
Free mapped binary SID.
[in] | ctx | Idmap context |
[in] | bin_sid | Binary SID to be freed. |
enum idmap_error_code sss_idmap_free_dom_sid | ( | struct sss_idmap_ctx * | ctx, |
struct sss_dom_sid * | dom_sid | ||
) |
Free mapped domain SID.
[in] | ctx | Idmap context |
[in] | dom_sid | Domain SID to be freed. |
enum idmap_error_code sss_idmap_free_sid | ( | struct sss_idmap_ctx * | ctx, |
char * | sid | ||
) |
Free mapped SID.
[in] | ctx | Idmap context |
[in] | sid | SID to be freed. |
enum idmap_error_code sss_idmap_free_smb_sid | ( | struct sss_idmap_ctx * | ctx, |
struct dom_sid * | smb_sid | ||
) |
Free mapped Samba SID.
[in] | ctx | Idmap context |
[in] | smb_sid | Samba SID to be freed. |
enum idmap_error_code sss_idmap_init | ( | idmap_alloc_func * | alloc_func, |
void * | alloc_pvt, | ||
idmap_free_func * | free_func, | ||
struct sss_idmap_ctx ** | ctx | ||
) |
Initialize idmap context.
[in] | alloc_func | Function to allocate memory for the context, if NULL malloc() id used |
[in] | alloc_pvt | Private data for allocation routine |
[in] | free_func | Function to free the memory the context, if NULL free() id used |
[out] | ctx | idmap context |
enum idmap_error_code sss_idmap_sid_to_bin_sid | ( | struct sss_idmap_ctx * | ctx, |
const char * | sid, | ||
uint8_t ** | bin_sid, | ||
size_t * | length | ||
) |
Convert SID string to binary SID.
[in] | ctx | Idmap context |
[in] | sid | Zero-terminated string representation of the SID |
[out] | bin_sid | Array with the binary SID, must be freed if not needed anymore |
[out] | length | Size of the array containing the binary SID |
enum idmap_error_code sss_idmap_sid_to_dom_sid | ( | struct sss_idmap_ctx * | ctx, |
const char * | sid, | ||
struct sss_dom_sid ** | dom_sid | ||
) |
Convert SID string to SID structure.
[in] | ctx | Idmap context |
[in] | sid | Zero-terminated string representation of the SID |
[out] | dom_sid | SID structure, must be freed if not needed anymore |
enum idmap_error_code sss_idmap_sid_to_smb_sid | ( | struct sss_idmap_ctx * | ctx, |
const char * | sid, | ||
struct dom_sid ** | smb_sid | ||
) |
Convert SID string to Samba dom_sid structure.
[in] | ctx | Idmap context |
[in] | sid | Zero-terminated string representation of the SID |
[out] | smb_sid | Samba dom_sid structure, must be freed if not needed anymore |
enum idmap_error_code sss_idmap_sid_to_unix | ( | struct sss_idmap_ctx * | ctx, |
const char * | sid, | ||
uint32_t * | id | ||
) |
Translate SID to a unix UID or GID.
[in] | ctx | Idmap context |
[in] | sid | Zero-terminated string representation of the SID |
[out] | id | Returned unix UID or GID |
enum idmap_error_code sss_idmap_smb_sid_to_bin_sid | ( | struct sss_idmap_ctx * | ctx, |
struct dom_sid * | smb_sid, | ||
uint8_t ** | bin_sid, | ||
size_t * | length | ||
) |
Convert Samba dom_sid structure to binary SID.
[in] | ctx | Idmap context |
[in] | smb_sid | Samba dom_sid structure |
[out] | bin_sid | Array with the binary SID, must be freed if not needed anymore |
[out] | length | Size of the array containing the binary SID |
enum idmap_error_code sss_idmap_smb_sid_to_dom_sid | ( | struct sss_idmap_ctx * | ctx, |
struct dom_sid * | smb_sid, | ||
struct sss_dom_sid ** | dom_sid | ||
) |
Convert Samba dom_sid structure to SID structure.
[in] | ctx | Idmap context |
[in] | smb_sid | Samba dom_sid structure |
[out] | dom_sid | SID structure, must be freed if not needed anymore |
enum idmap_error_code sss_idmap_smb_sid_to_sid | ( | struct sss_idmap_ctx * | ctx, |
struct dom_sid * | smb_sid, | ||
char ** | sid | ||
) |
Convert Samba dom_sid structure to SID string.
[in] | ctx | Idmap context |
[in] | smb_sid | Samba dom_sid structure |
[out] | sid | Zero-terminated string representation of the SID, must be freed if not needed anymore |
enum idmap_error_code sss_idmap_smb_sid_to_unix | ( | struct sss_idmap_ctx * | ctx, |
struct dom_sid * | smb_sid, | ||
uint32_t * | id | ||
) |
Translate a Samba dom_sid stucture to a unix UID or GID.
[in] | ctx | Idmap context |
[in] | smb_sid | Samba dom_sid structure |
[out] | id | Returned unix UID or GID |
enum idmap_error_code sss_idmap_unix_to_bin_sid | ( | struct sss_idmap_ctx * | ctx, |
uint32_t | id, | ||
uint8_t ** | bin_sid, | ||
size_t * | length | ||
) |
Translate unix UID or GID to a binary SID.
[in] | ctx | Idmap context |
[in] | id | unix UID or GID |
[out] | bin_sid | Array with the binary SID, must be freed if not needed anymore |
[out] | length | size of the array containing the binary SID |
enum idmap_error_code sss_idmap_unix_to_dom_sid | ( | struct sss_idmap_ctx * | ctx, |
uint32_t | id, | ||
struct sss_dom_sid ** | dom_sid | ||
) |
Translate unix UID or GID to a SID structure.
[in] | ctx | Idmap context |
[in] | id | unix UID or GID |
[out] | dom_sid | SID structure, must be freed if not needed anymore |
enum idmap_error_code sss_idmap_unix_to_sid | ( | struct sss_idmap_ctx * | ctx, |
uint32_t | id, | ||
char ** | sid | ||
) |
Translate unix UID or GID to a SID.
[in] | ctx | Idmap context |
[in] | id | unix UID or GID |
[out] | sid | Zero-terminated string representation of the SID, must be freed if not needed anymore |