be_refresh.c revision cc2d77d5218c188119fa954c856e858cbde76947
bbae6e6ca0de7f2ffbb44d2c8da179f2b717237fChristian Maeder Pavel Březina <pbrezina@redhat.com>
bbae6e6ca0de7f2ffbb44d2c8da179f2b717237fChristian Maeder Copyright (C) 2013 Red Hat
bbae6e6ca0de7f2ffbb44d2c8da179f2b717237fChristian Maeder This program is free software; you can redistribute it and/or modify
bbae6e6ca0de7f2ffbb44d2c8da179f2b717237fChristian Maeder it under the terms of the GNU General Public License as published by
bbae6e6ca0de7f2ffbb44d2c8da179f2b717237fChristian Maeder the Free Software Foundation; either version 3 of the License, or
bbae6e6ca0de7f2ffbb44d2c8da179f2b717237fChristian Maeder (at your option) any later version.
bbae6e6ca0de7f2ffbb44d2c8da179f2b717237fChristian Maeder This program is distributed in the hope that it will be useful,
bbae6e6ca0de7f2ffbb44d2c8da179f2b717237fChristian Maeder but WITHOUT ANY WARRANTY; without even the implied warranty of
bbae6e6ca0de7f2ffbb44d2c8da179f2b717237fChristian Maeder MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bbae6e6ca0de7f2ffbb44d2c8da179f2b717237fChristian Maeder GNU General Public License for more details.
fc7df539e6d41b050161ed8f9ae6e444b1b5ab14Christian Maeder You should have received a copy of the GNU General Public License
ee9eddfa6953868fd6fbaff0d9ff68675a13675aChristian Maeder along with this program. If not, see <http://www.gnu.org/licenses/>.
715ffaf874309df081d1e1cd8e05073fc1227729Christian Maederstatic errno_t be_refresh_get_values_ex(TALLOC_CTX *mem_ctx,
2a598ff0c1b7b51c33aee7029b43bc5cfcbea6b8Christian Maeder filter = talloc_asprintf(tmp_ctx, "(&(%s<=%lld))",
2a598ff0c1b7b51c33aee7029b43bc5cfcbea6b8Christian Maeder SYSDB_CACHE_EXPIRE, (long long) now + period);
2a598ff0c1b7b51c33aee7029b43bc5cfcbea6b8Christian Maeder ret = sysdb_search_entry(tmp_ctx, domain->sysdb, base_dn,
715ffaf874309df081d1e1cd8e05073fc1227729Christian Maeder ret = sysdb_msg2attrs(tmp_ctx, count, msgs, &records);
715ffaf874309df081d1e1cd8e05073fc1227729Christian Maeder "Could not convert ldb message to sysdb_attrs\n");
2a598ff0c1b7b51c33aee7029b43bc5cfcbea6b8Christian Maeder ret = sysdb_attrs_to_list(tmp_ctx, records, count, attr, &values);
5e26bfc8d7b18cf3a3fa7b919b4450fb669f37a5Christian Maederstatic errno_t be_refresh_get_values(TALLOC_CTX *mem_ctx,
5e26bfc8d7b18cf3a3fa7b919b4450fb669f37a5Christian Maeder base_dn = sysdb_user_base_dn(mem_ctx, domain);
5e26bfc8d7b18cf3a3fa7b919b4450fb669f37a5Christian Maeder base_dn = sysdb_group_base_dn(mem_ctx, domain);
5e26bfc8d7b18cf3a3fa7b919b4450fb669f37a5Christian Maeder base_dn = sysdb_netgroup_base_dn(mem_ctx, domain);
5e26bfc8d7b18cf3a3fa7b919b4450fb669f37a5Christian Maeder ret = be_refresh_get_values_ex(mem_ctx, domain, period, class,
struct be_refresh_ctx {
return NULL;
return ctx;
void *pvt)
return EINVAL;
return EEXIST;
return EOK;
struct be_refresh_state {
void *pvt)
struct be_refresh_state);
return NULL;
goto immediately;
goto immediately;
goto immediately;
return req;
return req;
goto done;
goto done;
goto done;
goto done;
done:
return ret;
goto done;
done:
return EOK;