/*
Authors:
Pavel Březina <pbrezina@redhat.com>
Copyright (C) 2016 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/>.
*/
#include <tevent.h>
#include <talloc.h>
#include "util/sss_ptr_hash.h"
#include "responder/nss/nss_private.h"
struct nss_enum_ctx *enum_ctx);
struct nss_setent_internal_state {
};
/* Cache request data is stealed on internal state. */
static struct tevent_req *
struct tevent_context *ev,
struct cache_req_data *data,
enum cache_req_type type,
struct nss_enum_ctx *enum_ctx,
{
return NULL;
}
/* Object is already constructed, just return here. */
goto done;
}
/* Object is being constructed. Register ourselves for
* notification when it is finished. */
"Unable to register setent reference [%d]: %s!\n",
goto done;
}
goto done;
}
/* Create new object. */
goto done;
}
done:
}
return req;
}
{
/* This is the ongoing request and it is finished. Remove it. */
switch (ret) {
case EOK:
/* We need to expand the netgroup into triples and members. */
result[0]->ldb_result,
goto done;
}
}
break;
case ENOENT:
/* Reset the result but build it again next time setent is called. */
goto done;
default:
/* In case of an error, we do not touch the enumeration context. */
goto done;
}
/* Expire the result object after its timeout is reached. */
goto done;
}
/* The object is ready now. */
done:
/* We want to finish the requests in correct order, this was the
* first request, notify_list contain the subsequent request.
*
* Because callback invoked from tevent_req_done will free state,
* we must remember notify_list explicitly to avoid segfault.
*/
} else {
}
}
static errno_t
{
return EOK;
}
static void
struct tevent_timer *te,
struct timeval current_time,
void *pvt)
{
/* Reset enumeration context. */
}
static errno_t
struct nss_enum_ctx *enum_ctx)
{
"Could not set up life timer for enumeration object.\n");
return ENOMEM;
}
return EOK;
}
struct tevent_req *
struct tevent_context *ev,
enum cache_req_type type,
struct nss_enum_ctx *enum_ctx)
{
return NULL;
}
}
{
return nss_setent_internal_recv(req);
}
static void
struct tevent_timer *te,
struct timeval current_time,
void *pvt)
{
/* Free enumeration context. This will also remove it from the table. */
}
static errno_t
struct nss_enum_ctx *enum_ctx)
{
if (nss_ctx->cache_refresh_percent) {
} else {
}
/* In order to not trash the cache between setnetgrent()/getnetgrent()
* calls with too low timeout values, we only allow 10 seconds as
* the minimal timeout
*/
"Could not set up life timer for enumeration object.\n");
return ENOMEM;
}
return EOK;
}
static struct nss_enum_ctx *
const char *netgroup)
{
return enum_ctx;
}
return NULL;
}
"Unable to add enumeration context into table [%d]: %s\n",
return NULL;
}
return enum_ctx;
}
struct tevent_req *
struct tevent_context *ev,
enum cache_req_type type,
const char *netgroup)
{
return NULL;
}
return NULL;
}
}
{
return nss_setent_internal_recv(req);
}