sdap_async_users.c revision fdda4b659fa3be3027df91a2b053835186ec2c59
6ca0e6973c8176100f4a426444823ae5e777e28fsascha Async LDAP Helper routines - retrieving users
6ca0e6973c8176100f4a426444823ae5e777e28fsascha Copyright (C) Simo Sorce <ssorce@redhat.com> - 2009
along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "providers/ldap/sdap_async_private.h"
#include "providers/ldap/ldap_common.h"
#include "providers/ldap/sdap_idmap.h"
#include "providers/ldap/sdap_users.h"
static errno_t
char *sid_str,
char *dom_sid_str,
char *group_sid_str;
if (!tmpctx) {
goto done;
&primary_gid);
goto done;
if (!dom_sid_str) {
&dom_sid_str);
goto done;
(unsigned long) primary_gid);
if (!group_sid_str) {
goto done;
done:
return ret;
bool is_initgr,
char **_usn_value,
int ret;
const char *pwd;
const char *gecos;
const char *homedir;
const char *shell;
size_t i;
int cache_timeout;
bool use_id_mapping;
char *sid_str;
if (!tmpctx) {
goto done;
goto done;
goto done;
goto done;
goto done;
if (!gecos) {
&sid_str);
goto done;
user_name));
sid_str);
if (use_id_mapping) {
goto done;
goto done;
goto done;
if (ret) {
goto done;
&uid);
goto done;
user_name));
goto done;
if (use_id_mapping) {
&gid);
if (ret) {
goto done;
goto done;
gid = 0;
&gid);
goto done;
user_name));
goto done;
if (ret) {
goto done;
if (ret) {
goto done;
if (ret) {
goto done;
if (ret) {
goto done;
goto done;
if (ret) {
goto done;
if (ret) {
goto done;
if (!usn_value) {
goto done;
if (ret) {
goto done;
if (!upn) {
goto done;
if (ret) {
goto done;
if (ret) {
goto done;
if (is_initgr) {
if (ret) {
goto done;
goto done;
goto done;
if (_usn_value) {
done:
if (ret) {
return ret;
int num_users,
char **_usn_value)
char *usn_value;
int ret;
bool in_transaction = false;
if (num_users == 0) {
return EOK;
if (!tmpctx) {
return ENOMEM;
if (ret) {
goto done;
in_transaction = true;
for (i = 0; i < num_users; i++) {
users[i], false,
if (ret) {
if (usn_value) {
if (higher_usn) {
if (ret) {
goto done;
in_transaction = false;
if (_usn_value) {
done:
if (in_transaction) {
return ret;
struct sdap_get_users_state {
const char **attrs;
const char *base_filter;
char *filter;
int timeout;
bool enumeration;
char *higher_usn;
const char **attrs,
const char *filter,
int timeout,
bool enumeration)
goto done;
done:
return req;
return ENOMEM;
if (!subreq) {
return ENOMEM;
return EOK;
struct tevent_req);
struct sdap_get_users_state);
int ret;
bool next_base = false;
if (ret) {
next_base = true;
if (count > 0) {
struct sysdb_attrs *,
for (i = 0; i < count; i++) {
if (next_base) {
if (ret) {
struct sdap_get_users_state);
if (usn_value) {
return EOK;
int ret;
if (name) {
if (!pwd) {
if (!ua) {
goto done;
if (!user) {
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
done:
return ret;