nss_get_object.c revision 431c7508e0d256b9c712cb9dcb9aa4cb635f4a0b
/*
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 "responder/nss/nss_private.h"
#include "responder/nss/nsssrv_mmap_cache.h"
static errno_t
struct sized_string *name,
enum sss_mc_type type)
{
switch (type) {
case SSS_MC_PASSWD:
break;
case SSS_MC_GROUP:
break;
case SSS_MC_INITGROUPS:
break;
default:
return EINVAL;
}
return EOK;
}
"Internal failure in memory cache code: %d [%s]\n",
return ret;
}
static errno_t
enum sss_mc_type type)
{
switch (type) {
case SSS_MC_PASSWD:
break;
case SSS_MC_GROUP:
break;
default:
return EINVAL;
}
return EOK;
}
"Internal failure in memory cache code: %d [%s]\n",
return ret;
}
static errno_t
struct sss_domain_info *domain,
const char *name,
enum sss_mc_type type)
{
struct sss_domain_info *dom;
struct sized_string *sized_name;
/* We found entry in this domain so we don't
* wont to invalidate it here. */
continue;
}
"Unable to create sized name [%d]: %s\n",
return ret;
}
"Unable to delete '%s' from domain '%s' memory cache!\n",
continue;
}
} else if (id == 0) {
/*
* As "root" is not handled by SSSD, let's just return EOK here
* instead of erroring out.
*/
return EOK;
} else if (id != 0) {
"Unable to delete '%u' from domain '%s' memory cache!\n",
continue;
}
} else {
return ERR_INTERNAL;
}
}
return EOK;
}
struct nss_get_object_state {
/* We delete object from memory cache if it is not found */
enum sss_mc_type memcache;
const char *input_name;
struct cache_req_result *result;
};
/* Cache request data memory context is stolen to internal state. */
struct tevent_req *
struct tevent_context *ev,
struct cache_req_data *data,
enum sss_mc_type memcache,
const char *input_name,
{
struct nss_get_object_state *state;
struct tevent_req *subreq;
struct tevent_req *req;
return NULL;
}
goto done;
}
goto done;
}
done:
}
return req;
}
{
struct nss_get_object_state *state;
struct tevent_req *req;
switch (ret) {
case EOK:
/* Delete entry from all domains but the one that was found. */
}
break;
case ENOENT:
/* Delete entry from all domains. */
}
break;
default:
break;
}
return;
}
struct tevent_req *req,
struct cache_req_result **_result,
const char **_rawname)
{
struct nss_get_object_state *state;
}
}
return EOK;
}