/*
SSSD
Common Responder utility functions
Copyright (C) Sumit Bose <sbose@redhat.com> 2014
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 <talloc.h>
#include "responder/common/responder.h"
#include "responder/common/cache_req/cache_req.h"
static inline bool
{
size_t i;
for (i = 0; i < nlist; i++) {
break;
}
}
return (i < nlist) ? true : false;
}
const char **defaults)
{
int list_size;
int conf_list_size = 0;
int i;
return NULL;
}
if (conf_str) {
&conf_list, &conf_list_size);
goto done;
}
goto done;
}
}
for (i = 0; i < conf_list_size; i++) {
switch (conf_list[i][0]) {
case '+':
ai++;
continue;
case '-':
di++;
continue;
default:
"either '+' (allow) or '-' (deny), got '%s'\n",
conf_list[i]);
goto done;
}
}
/* Assume the output will have to hold defaults and all the configured,
* values, resize later
*/
list_size = 0;
list_size++;
}
}
goto done;
}
/* Start by copying explicitly allowed attributes */
for (i = 0; i < ai; i++) {
/* if the attribute is explicitly denied, skip it */
continue;
}
goto done;
}
li++;
"Added allowed attr %s to whitelist\n", allow[i]);
}
/* Add defaults */
for (i = 0; defaults[i]; i++) {
/* if the attribute is explicitly denied, skip it */
continue;
}
goto done;
}
li++;
"Added default attr %s to whitelist\n", defaults[i]);
}
}
done:
return res;
}
struct sss_domain_info *dom,
bool name_is_upn,
const char *orig_name)
{
char *name;
return NULL;
}
return NULL;
}
return NULL;
}
if (name_is_upn == false) {
return NULL;
}
}
return name;
}
struct resp_resolve_group_names_state {
bool needs_refresh;
unsigned int group_iter;
};
struct tevent_context *ev,
struct sss_domain_info *dom,
struct ldb_result *initgr_res)
{
return NULL;
}
goto immediate;
goto immediate;
}
return req;
} else {
}
return req;
}
static bool
{
/* Refresh groups that have a non-zero GID,
* but are marked as non-POSIX
*/
bool is_posix;
return true;
}
return false;
}
{
state->group_iter++;
}
/* All groups were refreshed */
return EOK;
}
/* Fire a request */
SYSDB_GIDNUM, 0);
if (gid == 0) {
return EINVAL;
}
return ENOMEM;
}
0,
NULL,
data);
return ENOMEM;
}
return EAGAIN;
}
{
/* Try to refresh the others on error */
}
state->group_iter++;
state->needs_refresh = true;
return;
}
return;
return;
}
/* Continue refreshing.. */
}
static errno_t
{
const char *username;
/* re-read reply in case any groups were renamed */
/* msgs[0] is the user entry */
NULL);
return EINVAL;
}
return ret;
}
return EOK;
}
struct tevent_req *req,
struct ldb_result **_initgr_named_res)
{
return EOK;
}
const char *
struct sss_domain_info *domain)
{
const char *shell;
int i;
/* Check whether we are unconditionally overriding
* the server for the login shell. */
if (domain->override_shell) {
return domain->override_shell;
} else if (rctx->override_shell) {
return rctx->override_shell;
}
NULL);
/* Check whether there is a default shell specified */
if (domain->default_shell) {
return domain->default_shell;
} else if (rctx->default_shell) {
return rctx->default_shell;
}
return "";
}
return shell;
}
if (rctx->vetoed_shells) {
for (i = 0; rctx->vetoed_shells[i]; i++) {
"The shell '%s' is vetoed. Using fallback.\n",
shell);
return rctx->shell_fallback;
}
}
}
if (rctx->etc_shells) {
for (i = 0; rctx->etc_shells[i]; i++) {
break;
}
}
if (rctx->etc_shells[i]) {
return shell;
}
}
if (rctx->allowed_shells) {
"The shell '%s' is allowed but does not exist. "
"Using fallback\n", shell);
return rctx->shell_fallback;
} else {
for (i = 0; rctx->allowed_shells[i]; i++) {
"The shell '%s' is allowed but does not exist. "
"Using fallback\n", shell);
return rctx->shell_fallback;
}
}
}
}
"The shell '%s' is not allowed and does not exist.\n", shell);
return NOLOGIN_SHELL;
}