ldap_provider.c revision 7122f66c144b1837e22adef519103cfd9808db62
/*
SSSD
Test LDAP Module
Copyright (C) Simo Sorce <ssorce@redhat.com> 2008
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 <nss.h>
#include <errno.h>
#include <pwd.h>
#include <grp.h>
#include "providers/dp_backend.h"
struct ldap_nss_ops {
enum nss_status (*setpwent)(void);
enum nss_status (*endpwent)(void);
enum nss_status (*setgrent)(void);
enum nss_status (*endgrent)(void);
int *errnop);
};
struct ldap_ctx {
struct ldap_nss_ops ops;
};
{
enum nss_status status;
char *buffer;
int ret;
switch (status) {
case NSS_STATUS_NOTFOUND:
break;
case NSS_STATUS_SUCCESS:
break;
default:
return ret;
}
}
return ret;
}
{
*reply = MOD_ONLINE;
return EOK;
}
int entry_type, int attr_type,
int filter_type, char *filter_value)
{
switch (entry_type) {
case BE_REQ_USER: /* user */
switch (filter_type) {
case BE_FILTER_NAME:
switch (attr_type) {
case BE_ATTR_CORE:
/* TODO */
} else {
}
break;
default:
return EINVAL;
}
break;
case BE_FILTER_IDNUM:
break;
default:
return EINVAL;
}
break;
case BE_REQ_GROUP: /* group */
/* TODO */
return EOK;
default: /*fail*/
return EINVAL;
}
return EOK;
}
struct be_mod_ops ldap_mod_ops = {
};
{
void *handle;
int ret;
if (!ctx) {
return ENOMEM;
}
if (!handle) {
goto done;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
*ops = &ldap_mod_ops;
done:
}
return ret;
}