sss_cache.c revision 1330390c698ca0802200725df43356557aa633a2
db878466c5e95073429dda0bdd001f45e9486e16fielding Copyright (C) Jan Zeleny <jzeleny@redhat.com> 2011
db878466c5e95073429dda0bdd001f45e9486e16fielding This program is free software; you can redistribute it and/or modify
db878466c5e95073429dda0bdd001f45e9486e16fielding it under the terms of the GNU General Public License as published by
beaad6ac31022179c44d88536811e9ccd9425696nd the Free Software Foundation; either version 3 of the License, or
beaad6ac31022179c44d88536811e9ccd9425696nd (at your option) any later version.
beaad6ac31022179c44d88536811e9ccd9425696nd This program is distributed in the hope that it will be useful,
beaad6ac31022179c44d88536811e9ccd9425696nd but WITHOUT ANY WARRANTY; without even the implied warranty of
beaad6ac31022179c44d88536811e9ccd9425696nd MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
beaad6ac31022179c44d88536811e9ccd9425696nd GNU General Public License for more details.
beaad6ac31022179c44d88536811e9ccd9425696nd You should have received a copy of the GNU General Public License
beaad6ac31022179c44d88536811e9ccd9425696nd along with this program. If not, see <http://www.gnu.org/licenses/>.
7e68fce3cbd2246164e045a51ecd77f9f26680ednd#define INVALIDATE_EVERYTHING (INVALIDATE_USERS | INVALIDATE_GROUPS | \
7e68fce3cbd2246164e045a51ecd77f9f26680ednd#else /* BUILD_SSH */
66e48875fca2df6669dab4f2690ee36c6913c0ffnd#define INVALIDATE_EVERYTHING (INVALIDATE_USERS | INVALIDATE_GROUPS | \
7e68fce3cbd2246164e045a51ecd77f9f26680ednd#endif /* BUILD_SSH */
7e68fce3cbd2246164e045a51ecd77f9f26680ednd#else /* BUILD_AUTOFS */
29fb68cf24dbdb4985cbb4734cb6074ea4bbab26nd#define INVALIDATE_EVERYTHING (INVALIDATE_USERS | INVALIDATE_GROUPS | \
7e68fce3cbd2246164e045a51ecd77f9f26680ednd#else /* BUILD_SSH */
7e68fce3cbd2246164e045a51ecd77f9f26680ednd#define INVALIDATE_EVERYTHING (INVALIDATE_USERS | INVALIDATE_GROUPS | \
f5f948a91315652103ddae08be22d76f63ba96d4nd#endif /* BUILD_SSH */
8cfbcde8e416fd60132dd4324c42a5098da156cfnd#endif /* BUILD_AUTOFS */
7e68fce3cbd2246164e045a51ecd77f9f26680edndstatic void free_input_values(struct input_values *values);
7e68fce3cbd2246164e045a51ecd77f9f26680ednd const char *domain);
29fb68cf24dbdb4985cbb4734cb6074ea4bbab26ndstatic errno_t update_all_filters(struct cache_tool_ctx *tctx,
7e68fce3cbd2246164e045a51ecd77f9f26680ednd bool skipped = true;
29fb68cf24dbdb4985cbb4734cb6074ea4bbab26nd "Error initializing context for the application\n");
7e68fce3cbd2246164e045a51ecd77f9f26680ednd /* Update list of subdomains for this domain */
29fb68cf24dbdb4985cbb4734cb6074ea4bbab26nd "Failed to update subdomains for domain %s.\n", dinfo->name);
7e68fce3cbd2246164e045a51ecd77f9f26680ednd /* Update filters for each domain */
7e68fce3cbd2246164e045a51ecd77f9f26680ednd DEBUG(SSSDBG_CRIT_FAILURE, "Failed to update filters.\n");
7e68fce3cbd2246164e045a51ecd77f9f26680ednd "Could not start the transaction!\n");
7e68fce3cbd2246164e045a51ecd77f9f26680ednd skipped &= !invalidate_entries(tctx, dinfo, TYPE_NETGROUP,
7e68fce3cbd2246164e045a51ecd77f9f26680ednd skipped &= !invalidate_entries(tctx, dinfo, TYPE_SERVICE,
7e68fce3cbd2246164e045a51ecd77f9f26680ednd skipped &= !invalidate_entries(tctx, dinfo, TYPE_AUTOFSMAP,
7e68fce3cbd2246164e045a51ecd77f9f26680ednd skipped &= !invalidate_entries(tctx, dinfo, TYPE_SSH_HOST,
7e68fce3cbd2246164e045a51ecd77f9f26680ednd skipped &= !invalidate_entries(tctx, dinfo, TYPE_SUDO_RULE,
7e68fce3cbd2246164e045a51ecd77f9f26680ednd "Could not commit the transaction!\n");
7e68fce3cbd2246164e045a51ecd77f9f26680ednd "Failed to cancel transaction\n");
29fb68cf24dbdb4985cbb4734cb6074ea4bbab26nd if (skipped == true) {
goto done;
goto done;
done:
return ret;
bool force_case_sensitivity,
char **_filter)
char *filter;
char *sanitized;
char *lc_sanitized;
return EOK;
return ENOMEM;
goto done;
goto done;
if (!use_name) {
goto done;
switch (entry_type) {
case TYPE_USER:
case TYPE_GROUP:
if (!use_name) {
goto done;
goto done;
if (fmt) {
goto done;
done:
return ret;
TYPE_USER, false,
return ret;
TYPE_GROUP, false,
return ret;
TYPE_NETGROUP, false,
return ret;
TYPE_SERVICE, false,
return ret;
TYPE_AUTOFSMAP, true,
return ret;
TYPE_SSH_HOST, false,
return ret;
return ret;
return EOK;
const char *c_name;
bool iret;
if (!filter) return false;
switch (entry_type) {
case TYPE_USER:
case TYPE_GROUP:
case TYPE_NETGROUP:
case TYPE_SERVICE:
case TYPE_AUTOFSMAP:
case TYPE_SSH_HOST:
#ifdef BUILD_SSH
case TYPE_SUDO_RULE:
#ifdef BUILD_SUDO
iret = true;
for (i = 0; i < msg_count; i++) {
iret = false;
iret = false;
return iret;
if (sys_attrs) {
switch (entry_type) {
case TYPE_USER:
case TYPE_GROUP:
case TYPE_NETGROUP:
case TYPE_SERVICE:
case TYPE_AUTOFSMAP:
case TYPE_SSH_HOST:
#ifdef BUILD_SSH
case TYPE_SUDO_RULE:
#ifdef BUILD_SUDO
return EINVAL;
return ret;
const char *domain)
char *confdb_path;
int ret;
return ENOMEM;
return ret;
if (domain) {
return ret;
return ret;
return ret;
return ret;
return EOK;
#ifdef BUILD_AUTOFS
#ifdef BUILD_SSH
#ifdef BUILD_SUDO
goto fini;
switch (ret) {
#ifdef BUILD_SUDO
goto fini;
goto fini;
goto fini;
fini:
return ret;
static errno_t
#ifdef BUILD_AUTOFS
return ENOSYS;