sss_idmap
1.9.2
|
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. |
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 } |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
enum idmap_error_code | sss_idmap_free (struct sss_idmap_ctx *ctx) |
Free all the allocated memory of the idmap context. | |
const char * | idmap_error_string (enum idmap_error_code err) |
Translate error code to a string. | |
bool | is_domain_sid (const char *str) |
Check if given string can be used as domain SID. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. |
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_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_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_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_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_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_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 |