sysdb_subdomains.c revision a5a4e5b4836fdd693bab6e1c7f9d633d1440447d
/*
SSSD
System Database - Sub-domain related calls
Copyright (C) 2012 Jan Zeleny <jzeleny@redhat.com>
Copyright (C) 2012 Sumit Bose <sbose@redhat.com>
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "db/sysdb_private.h"
struct sysdb_subdom ***subdomain_list)
{
int i;
struct ldb_result *res;
const char *attrs[] = {"cn",
NULL};
struct sysdb_subdom **list;
const char *tmp_str;
goto done;
}
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
goto done;
}
goto done;
}
("The object [%s] doesn't have a name\n",
goto done;
}
goto done;
}
goto done;
}
}
goto done;
}
}
goto done;
}
}
}
done:
return ret;
}
struct sysdb_subdom **_info)
{
const char *tmp_str;
struct sysdb_subdom *info;
struct ldb_result *res;
const char *attrs[] = {"cn",
NULL};
return ENOMEM;
}
goto done;
}
goto done;
}
NULL);
if (ret != LDB_SUCCESS) {
goto done;
}
goto done;
}
goto done;
}
NULL);
goto done;
}
}
NULL);
goto done;
}
}
NULL);
goto done;
}
}
done:
return ret;
}
struct sysdb_subdom *domain_info)
{
struct ldb_message *msg;
int ret;
bool do_update = false;
struct sysdb_subdom *current_info;
return ENOMEM;
}
goto done;
}
goto done;
}
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
domain_info->realm);
if (ret != LDB_SUCCESS) {
goto done;
}
do_update = true;
}
if (ret != LDB_SUCCESS) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
do_update = true;
}
NULL);
if (ret != LDB_SUCCESS) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
do_update = true;
}
if (do_update == false) {
goto done;
}
if (ret != LDB_SUCCESS) {
"[%s]: [%d][%s]!\n",
goto done;
}
done:
return ret;
}
struct sysdb_subdom *domain_info)
{
struct ldb_message *msg;
int ret;
return ENOMEM;
}
goto done;
}
domain_info->name);
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
NULL);
if (ret != LDB_SUCCESS) {
goto done;
}
domain_info->realm);
if (ret != LDB_SUCCESS) {
goto done;
}
}
NULL);
if (ret != LDB_SUCCESS) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
}
NULL);
if (ret != LDB_SUCCESS) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
}
if (ret != LDB_SUCCESS) {
"[%s]: [%d][%s]!\n",
goto done;
}
done:
return ret;
}
int num_subdoms,
struct sysdb_subdom *subdoms)
{
int ret;
int sret;
size_t c;
size_t d;
struct sysdb_subdom **cur_subdomains;
bool in_transaction = false;
bool *keep_subdomain;
goto done;
}
/* Retrieve all subdomains that are currently in sysdb */
goto done;
}
if (keep_subdomain == NULL) {
goto done;
}
goto done;
}
in_transaction = true;
/* Go through a list of retrieved subdomains and:
* - if a subdomain already exists in sysdb, mark it for preservation
* - if the subdomain doesn't exist in sysdb, create its bare structure
*/
for (c = 0; c < num_subdoms; c++) {
for (d = 0; d < cur_subdomains_count; d++) {
cur_subdomains[d]->name) == 0) {
keep_subdomain[d] = true;
/* sub-domain already in cache, nothing to do */
break;
}
}
if (d == cur_subdomains_count) {
goto done;
}
("sysdb_add_subdomain_attributes failed.\n"));
goto done;
}
}
}
/* Now delete all subdomains that have been in sysdb prior to
* refreshing the list and are not marked for preservation
* (i.e. they are not in the new list of subdomains)
*/
for (d = 0; d < cur_subdomains_count; d++) {
if (!keep_subdomain[d]) {
cur_subdomains[d]->name));
cur_subdomains[d]->name);
goto done;
}
goto done;
}
}
}
goto done;
}
in_transaction = false;
done:
if (in_transaction) {
}
}
return ret;
}
struct sss_domain_info *subdomain,
struct sysdb_ctx **subdomain_ctx)
{
return ENOMEM;
}
*subdomain_ctx = new_ctx;
return EOK;
}
#define CHECK_DOMAIN_INFO(dom_info) do { \
return EINVAL; \
} \
} while(0)
const char *name,
const char *pwd,
const char *gecos,
const char *homedir,
const char *shell,
struct sysdb_attrs *attrs,
char **remove_attrs,
{
}
{
}
struct sss_domain_info *domain,
const char *name,
const char **attrs,
struct ldb_message **msg)
{
}
struct sss_domain_info *domain,
const char **attrs,
struct ldb_message **msg)
{
}
const char *name,
struct sysdb_attrs *attrs,
{
now);
}
{
}