simple_access.c revision ffb83ee934f6ea1d9077ab601530436eff2d20e4
/*
SSSD
Simple access control
Copyright (C) Sumit Bose <sbose@redhat.com> 2010
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/simple/simple_access.h"
#include "util/sss_utf8.h"
#include "providers/dp_backend.h"
#define CONFDB_SIMPLE_ALLOW_USERS "simple_allow_users"
#define CONFDB_SIMPLE_DENY_USERS "simple_deny_users"
#define CONFDB_SIMPLE_ALLOW_GROUPS "simple_allow_groups"
#define CONFDB_SIMPLE_DENY_GROUPS "simple_deny_groups"
{
struct tevent_req *req;
struct simple_ctx *ctx;
goto done;
}
struct simple_ctx);
if (!req) {
goto done;
}
return;
done:
}
{
bool access_granted = false;
goto done;
}
if (access_granted) {
} else {
}
done:
}
char **list,
char ***_out)
{
size_t i;
return EOK;
}
goto done;
}
/* count size */
}
goto done;
}
/* Since this is access provider, we should fail on any error so we don't
* allow unauthorized access. */
for (i = 0; i < size; i++) {
goto done;
}
/* main domain, remember the name without domain part */
} else {
"Check you configuration.\n", list[i]));
goto done;
}
}
done:
return ret;
}
struct bet_ops simple_access_ops = {
};
void **pvt_data)
{
struct simple_ctx *ctx;
int i;
struct {
const char *name;
const char *option;
char **orig_list;
char ***ctx_list;
return ENOMEM;
}
continue;
goto failed;
}
goto failed;
}
}
if (!ctx->allow_users &&
!ctx->allow_groups &&
!ctx->deny_users &&
!ctx->deny_groups) {
"Access will be granted for all users.\n"));
}
*ops = &simple_access_ops;
return EOK;
return ret;
}