nsssrv_nc.h revision 1c48b5a62f73234ed26bb20f0ab345ab61cda0ab
2N/A/*
2N/A SSSD
2N/A
2N/A NSS Responder
2N/A
2N/A Copyright (C) Simo Sorce <ssorce@redhat.com> 2008
2N/A
2N/A This program is free software; you can redistribute it and/or modify
2N/A it under the terms of the GNU General Public License as published by
2N/A the Free Software Foundation; either version 3 of the License, or
2N/A (at your option) any later version.
2N/A
2N/A This program is distributed in the hope that it will be useful,
2N/A but WITHOUT ANY WARRANTY; without even the implied warranty of
2N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2N/A GNU General Public License for more details.
2N/A
2N/A You should have received a copy of the GNU General Public License
2N/A along with this program. If not, see <http://www.gnu.org/licenses/>.
2N/A*/
2N/A
2N/A#ifndef _NSS_NEG_CACHE_H_
2N/A#define _NSS_NEG_CACHE_H_
2N/A
2N/Astruct nss_nc_ctx;
2N/A
2N/A/* init the in memory negative cache */
2N/Aint nss_ncache_init(TALLOC_CTX *memctx, struct nss_nc_ctx **_ctx);
2N/A
2N/A/* check if the user is expired according to the passed in time to live */
2N/Aint nss_ncache_check_user(struct nss_nc_ctx *ctx, int ttl,
2N/A const char *domain, const char *name);
2N/Aint nss_ncache_check_group(struct nss_nc_ctx *ctx, int ttl,
2N/A const char *domain, const char *name);
2N/Aint nss_ncache_check_uid(struct nss_nc_ctx *ctx, int ttl, uid_t uid);
2N/Aint nss_ncache_check_gid(struct nss_nc_ctx *ctx, int ttl, gid_t gid);
2N/A
2N/A/* add a new neg-cache entry setting the timestamp to "now" unless
2N/A * "permanent" is set to true, in which case the timestamps is set to 0
2N/A * and the negative cache never expires (used to permanently filter out
2N/A * users and groups) */
2N/Aint nss_ncache_set_user(struct nss_nc_ctx *ctx, bool permanent,
2N/A const char *domain, const char *name);
2N/Aint nss_ncache_set_group(struct nss_nc_ctx *ctx, bool permanent,
2N/A const char *domain, const char *name);
2N/Aint nss_ncache_set_uid(struct nss_nc_ctx *ctx, bool permanent, uid_t uid);
2N/Aint nss_ncache_set_gid(struct nss_nc_ctx *ctx, bool permanent, gid_t gid);
2N/A
2N/Aint nss_ncache_reset_permament(struct nss_nc_ctx *ctx);
2N/A
2N/A#endif /* _NSS_NEG_CACHE_H_ */
2N/A