sysdb_search.c revision 9f37bb2012faa136ef7c1f9fe93689ce2be85637
eaf6669b6ce9b9714e451d5cc81ba30c802c89fcsf System Database
eaf6669b6ce9b9714e451d5cc81ba30c802c89fcsf Copyright (C) Simo Sorce <ssorce@redhat.com> 2008
eaf6669b6ce9b9714e451d5cc81ba30c802c89fcsf This program is free software; you can redistribute it and/or modify
eaf6669b6ce9b9714e451d5cc81ba30c802c89fcsf it under the terms of the GNU General Public License as published by
eaf6669b6ce9b9714e451d5cc81ba30c802c89fcsf the Free Software Foundation; either version 3 of the License, or
eaf6669b6ce9b9714e451d5cc81ba30c802c89fcsf (at your option) any later version.
eaf6669b6ce9b9714e451d5cc81ba30c802c89fcsf This program is distributed in the hope that it will be useful,
eaf6669b6ce9b9714e451d5cc81ba30c802c89fcsf but WITHOUT ANY WARRANTY; without even the implied warranty of
eaf6669b6ce9b9714e451d5cc81ba30c802c89fcsf MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
eaf6669b6ce9b9714e451d5cc81ba30c802c89fcsf GNU General Public License for more details.
eaf6669b6ce9b9714e451d5cc81ba30c802c89fcsf You should have received a copy of the GNU General Public License
eaf6669b6ce9b9714e451d5cc81ba30c802c89fcsf along with this program. If not, see <http://www.gnu.org/licenses/>.
886d55e313c02587932104534df2e294058dd369sf/* users */
eaf6669b6ce9b9714e451d5cc81ba30c802c89fcsf const char *name,
eaf6669b6ce9b9714e451d5cc81ba30c802c89fcsf const char *src_name;
d45baca3dcd361f43bbe709eadbb29207609b32ajailletc /* If this is a subomain we need to use fully qualified names for the
eaf6669b6ce9b9714e451d5cc81ba30c802c89fcsf * search as well by default */
eaf6669b6ce9b9714e451d5cc81ba30c802c89fcsf src_name = talloc_asprintf(tmp_ctx, domain->names->fq_fmt,
a3888aa66c841416bde645d3714fa6540daccacfjailletc ret = sss_filter_sanitize(tmp_ctx, src_name, &sanitized_name);
d45baca3dcd361f43bbe709eadbb29207609b32ajailletc ret = ldb_search(sysdb->ldb, tmp_ctx, &res, base_dn,
d45baca3dcd361f43bbe709eadbb29207609b32ajailletc ret = ldb_search(sysdb->ldb, tmp_ctx, &res, base_dn,
b125ec755c78472e8e5313f16e7ccb50382083e9sf/* groups */
b125ec755c78472e8e5313f16e7ccb50382083e9sf /* see if this is a user to convert to a group */
886d55e313c02587932104534df2e294058dd369sf /* no, leave as is */
eaf6669b6ce9b9714e451d5cc81ba30c802c89fcsf /* yes, convert */
eaf6669b6ce9b9714e451d5cc81ba30c802c89fcsf val->data = (uint8_t *)talloc_strdup(msg, SYSDB_GROUP_CLASS);
int ret;
if (ret) {
return ret;
return EOK;
const char *name,
const char *fmt_filter;
char *sanitized_name;
const char *src_name;
int ret;
if (!tmp_ctx) {
return ENOMEM;
if (!base_dn) {
goto done;
if (!src_name) {
goto done;
goto done;
if (ret) {
goto done;
if (ret) {
goto done;
done:
return ret;
const char *fmt_filter;
int ret;
if (!tmp_ctx) {
return ENOMEM;
if (!base_dn) {
goto done;
if (ret) {
goto done;
if (ret) {
goto done;
done:
return ret;
const char *fmt_filter;
int ret;
if (!tmp_ctx) {
return ENOMEM;
if (!base_dn) {
goto done;
if (ret) {
goto done;
if (ret) {
goto done;
done:
return ret;
const char *name,
int ret;
if (!tmp_ctx) {
return ENOMEM;
goto done;
goto done;
goto done;
if (!ctrl) {
goto done;
if (!ctrl[0]) {
goto done;
if (!control) {
goto done;
goto done;
NULL);
goto done;
goto done;
done:
return ret;
const char *name,
const char **attributes,
char *sanitized_name;
int ret;
if (!tmp_ctx) {
return ENOMEM;
if (!base_dn) {
goto done;
goto done;
if (ret) {
goto done;
done:
return ret;
const char *triple,
char **hostname,
char **username,
char **domainname)
const char *p = triple;
const char *p_host;
const char *p_user;
const char *p_domain;
if (!tmp_ctx) {
return ENOMEM;
while (*p && isspace(*p)) p++;
goto done;
p_host = p;
goto done;
if (len > 0) {
if (!host) {
goto done;
p_user = p;
goto done;
if (len > 0) {
if (!user) {
goto done;
p_domain = p;
goto done;
if (len > 0) {
if (!domain) {
goto done;
while (*p && isspace(*p)) p++;
goto done;
if (host) {
if (user) {
if (domain) {
done:
return ret;
size_t c = 0;
char *triple_str;
return ENOENT;
if (!tmp_ctx) {
return ENOMEM;
goto done;
if (size != 0) {
if (!triple_str) {
goto done;
struct sysdb_netgroup_ctx);
if (!tmp_entry[c]) {
goto done;
goto done;
struct sysdb_netgroup_ctx);
if (!tmp_entry[c]) {
goto done;
goto done;
done:
return ret;
const char *netgroup,
char *sanitized_netgroup;
char *netgroup_dn;
int lret;
if (!tmp_ctx) {
return ENOMEM;
if (!base_dn) {
goto done;
goto done;
if (!netgroup_dn) {
goto done;
goto done;
done:
return ret;
const char *netgrname,
const char **attributes,
char *sanitized_netgroup;
int ret;
if (!tmp_ctx) {
return ENOMEM;
if (!base_dn) {
goto done;
goto done;
if (ret) {
goto done;
done:
return ret;
const char *name,
char ***_direct_parents)
const char *dn;
char *sanitized_dn;
const char *member_filter;
int i, pi;
const char *tmp_str;
goto done;
if (!dn) {
goto done;
goto done;
if (!member_filter) {
goto done;
if (!basedn) {
goto done;
direct_sysdb_count = 0;
goto done;
if (!direct_parents) {
goto done;
pi = 0;
for(i = 0; i < direct_sysdb_count; i++) {
if (!tmp_str) {
goto done;
pi++;
done:
return ret;