nsssrv_nc.c revision 8f4aaae28c88c707853f8f28d8babc4efe0c1bf6
/*
SSSD
NSS Responder
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 <fcntl.h>
#include <time.h>
#include "tdb.h"
#define NC_ENTRY_PREFIX "NCE/"
struct nss_nc_ctx {
struct tdb_context *tdb;
};
{
return EOK;
}
{
struct nss_nc_ctx *ctx;
errno = 0;
/* open a memory only tdb with default hash size */
return EOK;
};
{
unsigned long long int timestamp;
bool expired = false;
char *ep;
int ret;
goto done;
}
if (ttl == -1) {
/* a negative ttl means: never expires */
goto done;
}
errno = 0;
/* Malformed entry, remove it and return no entry */
expired = true;
goto done;
}
if (timestamp == 0) {
/* a 0 timestamp means this is a permanent entry */
goto done;
}
/* still valid */
goto done;
}
expired = true;
done:
if (expired) {
/* expired, remove and return no entry */
}
return ret;
}
{
char *timest;
int ret;
if (permanent) {
} else {
}
if (ret != 0) {
}
done:
return ret;
}
{
char *str;
int ret;
return ret;
}
{
char *str;
int ret;
return ret;
}
{
char *str;
int ret;
return ret;
}
{
char *str;
int ret;
return ret;
}
{
char *str;
int ret;
return ret;
}
{
char *str;
int ret;
return ret;
}
{
char *str;
int ret;
return ret;
}
{
char *str;
int ret;
return ret;
}
{
unsigned long long int timestamp;
bool remove_key = false;
char *ep;
NC_ENTRY_PREFIX, sizeof(NC_ENTRY_PREFIX)) != 0) {
/* not interested in this key */
return 0;
}
errno = 0;
/* Malformed entry, remove it */
remove_key = true;
goto done;
}
if (timestamp == 0) {
/* a 0 timestamp means this is a permanent entry */
remove_key = true;
}
done:
if (remove_key) {
}
return 0;
}
{
int ret;
if (ret < 0)
return EIO;
return EOK;
}