proxy_init.c revision c8708cd958c633cc3c57a3460bdb15391200e1e1
/*
SSSD
Authors:
Stephen Gallagher <sgallagh@redhat.com>
Copyright (C) 2010 Red Hat
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/>.
*/
struct sbus_connection *conn);
static struct sbus_method proxy_methods[] = {
};
struct sbus_interface proxy_interface = {
};
{
/* TODO: Clean up any internal data */
}
{
}
struct bet_ops proxy_id_ops = {
.check_online = NULL
};
struct bet_ops proxy_auth_ops = {
};
struct bet_ops proxy_access_ops = {
};
struct bet_ops proxy_chpass_ops = {
};
{
char *funcname;
void *funcptr;
return funcptr;
}
{
struct proxy_id_ctx *ctx;
char *libname;
char *libpath;
void *handle;
int ret;
if (!ctx) {
return ENOMEM;
}
goto done;
}
if (!libpath) {
goto done;
}
if (!handle) {
DEBUG(0, ("Unable to load %s module with path, error: %s\n",
goto done;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
libname);
"_nss_XXX_initgroups_dyn function!\n"
"initgroups will be slow as it will require "
"full groups enumeration!\n", libname));
}
DEBUG(0, ("Failed to load _nss_%s_setnetgrent, error: %s. "
"The library does not support netgroups.\n", libname,
dlerror()));
}
libname);
DEBUG(0, ("Failed to load _nss_%s_getnetgrent_r, error: %s. "
"The library does not support netgroups.\n", libname,
dlerror()));
}
DEBUG(0, ("Failed to load _nss_%s_endnetgrent, error: %s. "
"The library does not support netgroups.\n", libname,
dlerror()));
}
*ops = &proxy_id_ops;
done:
}
return ret;
}
struct proxy_client {
struct proxy_auth_ctx *proxy_auth_ctx;
struct sbus_connection *conn;
struct tevent_timer *timeout;
bool initialized;
};
struct tevent_timer *te,
{
struct proxy_auth_ctx *proxy_auth_ctx;
struct proxy_client *proxy_cli;
/* hang off this memory to the connection so that when the connection
* is freed we can potentially call a destructor */
if (!proxy_cli) {
DEBUG(0,("Out of memory?!\n"));
return ENOMEM;
}
proxy_cli->initialized = false;
/* 5 seconds should be plenty */
DEBUG(0,("Out of memory?!\n"));
return ENOMEM;
}
/* Attach the client context to the connection context, so that it is
* always available when we need to manage the connection. */
return EOK;
}
struct tevent_timer *te,
{
struct proxy_client *proxy_cli;
/* If we time out here, we will also time out to
* pc_init_timeout(), so we'll finish the request
* there.
*/
}
struct sbus_connection *conn)
{
struct proxy_client *proxy_cli;
void *data;
int hret;
struct tevent_req *req;
struct proxy_child_ctx *child_ctx;
struct pc_init_ctx *init_ctx;
if (!proxy_cli) {
DEBUG(0, ("Connection holds no valid init data\n"));
return EINVAL;
}
/* First thing, cancel the timeout */
if (!dbret) {
/* FIXME: should we just talloc_zfree(conn) ? */
return EIO;
}
/* Check the hash table */
return EIO;
}
/* reply that all is ok */
if (!reply) {
DEBUG(0, ("Dbus Out of memory!\n"));
return ENOMEM;
}
if (!dbret) {
DEBUG(0, ("Failed to build dbus reply\n"));
return EIO;
}
/* send reply back */
if (hret != HASH_SUCCESS) {
}
/* Signal that the child is up and ready to receive the request */
/* This should hopefully be impossible, but protect
* against it anyway. If we're not marked running, then
* the init_req will be NULL below and things will
* break.
*/
"that's not marked as running\n"));
return EIO;
}
return EOK;
}
{
struct proxy_auth_ctx *ctx;
int ret;
int hret;
char *sbus_address;
/* If we're already set up, just return that */
return EOK;
}
if (!ctx) {
return ENOMEM;
}
&ctx->pam_target);
if (!ctx->pam_target) {
goto done;
}
if (sbus_address == NULL) {
goto done;
}
DEBUG(0, ("Could not set up sbus server.\n"));
goto done;
}
/* Set up request hash table */
/* FIXME: get max_children from configuration file */
if (hret != HASH_SUCCESS) {
DEBUG(0, ("Could not initialize request table\n"));
goto done;
}
*ops = &proxy_auth_ops;
done:
}
return ret;
}
{
int ret;
*ops = &proxy_access_ops;
return ret;
}
{
int ret;
*ops = &proxy_chpass_ops;
return ret;
}