sdap.c revision 4bca21e23e0b0e2df610d7edb4b205698e8224c0
/*
SSSD
LDAP Helper routines
Copyright (C) Simo Sorce <ssorce@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/>.
*/
#define LDAP_DEPRECATED 1
/* =Retrieve-Options====================================================== */
struct confdb_ctx *cdb,
const char *conf_path,
struct sdap_attr_map *def_map,
int num_entries,
struct sdap_attr_map **_map)
{
struct sdap_attr_map *map;
int i, ret;
if (!map) {
return ENOMEM;
}
for (i = 0; i < num_entries; i++) {
return EINVAL;
}
}
}
return EOK;
}
/* =Parse-msg============================================================= */
{
struct sysdb_attrs *attrs;
struct ldb_val v;
char *str;
int lerrno;
int a, i, ret;
const char *name;
bool store;
lerrno = 0;
if (!str) {
goto fail;
}
if (_dn) {
if (!*_dn) {
goto fail;
}
}
if (map) {
if (!vals) {
goto fail;
}
for (i = 0; vals[i]; i++) {
/* the objectclass is always the first name in the map */
/* ok it's an entry of the right type */
break;
}
}
if (!vals[i]) {
goto fail;
}
}
if (!str) {
if (map) {
goto fail;
}
}
while (str) {
if (map) {
for (a = 1; a < attrs_num; a++) {
/* check if this attr is valid with the chosen schema */
/* check if it is an attr we are interested in */
}
/* interesting attr */
if (a < attrs_num) {
store = true;
} else {
store = false;
}
} else {
store = true;
}
if (store) {
if (!vals) {
goto fail;
}
if (!vals[0]) {
goto fail;
}
for (i = 0; vals[i]; i++) {
}
}
}
if (lerrno) {
goto fail;
}
return EOK;
fail:
return ret;
}
/* This function converts an ldap message into a sysdb_attrs structure.
* It converts only known user attributes, the rest are ignored.
* If the entry is not that of an user an error is returned.
* The original DN is stored as an attribute named originalDN */
{
}
/* This function converts an ldap message into a sysdb_attrs structure.
* It converts only known group attributes, the rest are ignored.
* If the entry is not that of an user an error is returned.
* The original DN is stored as an attribute named originalDN */
{
}
/* =Get-DN-from-message=================================================== */
{
char *str;
int lerrno;
lerrno = 0;
if (!str) {
return EIO;
}
return EOK;
}
{
int ret;
const char *tls_opt;
if (tls_opt) {
}
}
}
}
}
else {
return EINVAL;
}
/* LDAP_OPT_X_TLS_REQUIRE_CERT has to be set as a global option,
if (ret != LDAP_OPT_SUCCESS) {
return EIO;
}
}
if (tls_opt) {
if (ret != LDAP_OPT_SUCCESS) {
return EIO;
}
}
if (tls_opt) {
if (ret != LDAP_OPT_SUCCESS) {
return EIO;
}
}
return EOK;
}
const char *sasl_mech)
{
int i;
if (!sasl_mech) return false;
continue;
}
break;
}
if (!el) {
/* no supported SASL Mechanism at all ? */
return false;
}
for (i = 0; i < el->num_values; i++) {
continue;
}
return true;
}
return false;
}
struct sdap_attr_map *map,
{
char **attrs;
int i, j;
/* first attribute is "objectclass" not the specifc one */
/* add the others */
for (i = j = 1; i < size; i++) {
j++;
}
}
return EOK;
}