Beispiel #1
0
errno_t get_uid_table(TALLOC_CTX *mem_ctx, hash_table_t **table)
{
#ifdef __linux__
    int ret;

    ret = hash_create_ex(INITIAL_TABLE_SIZE, table, 0, 0, 0, 0,
                         hash_talloc, hash_talloc_free, mem_ctx,
                         NULL, NULL);
    if (ret != HASH_SUCCESS) {
        DEBUG(SSSDBG_CRIT_FAILURE,
              "hash_create_ex failed [%s]\n", hash_error_string(ret));
        return ENOMEM;
    }

    return get_active_uid_linux(*table, 0);
#else
    return ENOSYS;
#endif
}
Beispiel #2
0
// create a hash table with key size optionally specified
// this function allocates memory so hash_delete has to be called to free memory
hash_t *hash_create() {
	return hash_create_ex(hash_config_create());
}