ipa_access.c revision 90890b6f4ee75194db0e6dc9c99a8d21f34dd8be
/*
SSSD
IPA Backend Module -- Access control
Authors:
Sumit Bose <sbose@redhat.com>
Copyright (C) 2009 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 <security/pam_modules.h>
#include "providers/ldap/sdap_async.h"
#include "providers/ipa/ipa_common.h"
#include "providers/ipa/ipa_access.h"
struct dp_option *ipa_options)
{
char *base;
int ret;
}
&base);
return NULL;
}
return base;
}
{
return EOK;
if (ret == RULE_NOT_APPLICABLE) {
} else {
}
return EOK;
}
return EOK;
}
{
int pam_status = PAM_SYSTEM_ERR;
struct ipa_access_ctx *ipa_access_ctx;
int ret;
goto fail;
}
struct ipa_access_ctx);
goto fail;
}
goto fail;
}
return;
fail:
if (hbac_ctx) {
/* Return an proper error */
} else {
}
}
{
struct tevent_req *subreq;
int ret;
if (hbac_ctx_is_offline(hbac_ctx)) {
return hbac_get_host_info_step(hbac_ctx);
}
if (!subreq) {
return ret;
}
return EOK;
}
{
if (dp_error == DP_ERR_OFFLINE) {
/* switching to offline mode */
goto fail;
}
goto fail;
}
return;
fail:
}
/* Check the step result code and continue, retry, get offline result or abort accordingly */
{
int dp_error;
return true;
}
if (hbac_ctx_is_offline(hbac_ctx)) {
/* already offline => the error is fatal */
return false;
}
if (dp_error == DP_ERR_OFFLINE) {
/* switching to offline mode */
}
/* retry */
return false;
}
}
}
return false;
}
{
const char *hostlist[3];
struct tevent_req *subreq;
return EINVAL;
}
} else {
}
if (!subreq) {
return ENOMEM;
}
return EOK;
}
{
int ret;
int pam_status = PAM_SYSTEM_ERR;
const char *ipa_hostname;
return;
}
if (ipa_hostname == NULL) {
goto fail;
}
&hbac_ctx->remote_hhi);
goto fail;
}
goto fail;
}
goto fail;
}
return;
fail:
}
{
int ret;
int pam_status = PAM_SYSTEM_ERR;
hbac_ctx->hbac_rule_count = 0;
return;
}
goto failed;
}
return;
}
{
int ret;
int pam_status = PAM_SYSTEM_ERR;
bool access_allowed = false;
hbac_ctx->hbac_services_count = 0;
return;
}
}
if (!hbac_ctx_is_offline(hbac_ctx)) {
"offline authentication might not work.\n"));
/* This is not a fatal error. */
}
}
hbac_ctx->groups_count = 0;
goto failed;
}
goto failed;
}
if (access_allowed) {
} else {
}
}