/*
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 <talloc.h>
#include <tevent.h>
#include "sbus/sssd_dbus.h"
#include "providers/data_provider/dp_private.h"
#include "providers/data_provider/dp_iface.h"
#include "responder/nss/nss_iface.h"
const char *filter,
const char *extra)
{
/* We will use sizeof() to determine the length of a string so we don't
* call strlen over and over again with each request. Not a bottleneck,
* but unnecessary and simple to avoid. */
static struct {
const char *name;
{0, 0, 0}};
int i;
if (SBUS_IS_STRING_EMPTY(filter)) {
return false;
}
return true;
}
}
return true;
}
return false;
}
struct dp_initgr_ctx {
const char *domain;
const char *filter_value;
const char *username;
};
const char *domain,
struct sss_domain_info *domain_info,
const char *filter_value,
struct ldb_result *res)
{
const char *username;
unsigned int i;
return NULL;
}
/* Copy domain name */
goto done;
}
/* Copy filter value */
goto done;
}
/* Reference domain info */
/* If we had the data in sysdb */
/* Copy original username */
goto done;
}
goto done;
}
/* Copy group IDs */
goto done;
}
/* The first GID is the primary so it might be duplicated
* later in the list. */
SYSDB_GIDNUM, 0);
/* If 0 it may be a non-POSIX group, so we skip it. */
}
}
}
done:
return NULL;
}
return ctx;
}
struct data_provider *provider,
struct dp_initgr_ctx *ctx)
{
int num;
/* If user didn't exist in the cache previously */
/* There is no point in contacting NSS responder */
return;
}
return;
}
return;
}
if (!dbret) {
return;
}
"Ordering NSS responder to update memory cache\n");
return;
}
struct dp_initgr_ctx *ctx)
{
bool enabled = false;
const char *name;
char *output_name;
char **conf_user;
char **conf_group;
size_t i;
/* If selective session recording is not enabled */
goto done;
}
/* Allocate temporary talloc context */
"Failed creating temporary talloc context\n");
goto done;
}
/* Get updated initgroups data with overrides */
goto done;
sss_strerror(ret));
goto done;
}
/* Delete sessionRecording attribute so we know when we failed */
"Failed removing %s attribute: %s\n",
goto done;
}
/* Format output username */
"Failed formatting output username from \"%s\": %s\n",
goto done;
}
/* For each user name in session recording config */
/* If it matches the requested user name */
enabled = true;
}
}
}
/* If we have groups in config and are not yet enabled */
!enabled) {
/* For each group in response */
/* Get the group msg */
if (i == 0) {
/* Get the primary group */
SYSDB_GIDNUM, 0);
if (gid == 0) {
continue;
}
continue;
"Failed retrieving group #%llu: %s\n",
goto done;
continue;
}
} else {
}
/* Get the group's output name */
continue;
}
&output_name);
"Failed formatting output group name from \"%s\": %s\n",
goto done;
}
/* For each group in configuration */
conf_group++) {
enabled = true;
}
}
}
}
/* Set sessionRecording attribute to enabled value */
"Failed creating attributes\n");
goto done;
}
"Failed setting %s attribute: %s\n",
goto done;
}
"Failed storing %s attribute: %s\n",
goto done;
}
done:
}
struct data_provider *provider,
struct dp_initgr_ctx *ctx,
struct dp_reply_std *reply)
{
(void)reply;
}
const char *key,
struct dp_id_data *data)
{
} else {
return ERR_DOMAIN_NOT_FOUND;
}
}
goto done;
}
goto done;
}
dp_req_reply_std, struct dp_reply_std);
done:
return ret;
}
void *dp_cli,
const char *filter,
const char *domain,
const char *extra)
{
const char *key;
return ENOMEM;
}
goto done;
}
filter);
goto done;
}
goto done;
}
}
dp_req_reply_std, struct dp_reply_std);
done:
}
return ret;
}
static bool
const char *filter)
{
/* We will use sizeof() to determine the length of a string so we don't
* call strlen over and over again with each request. Not a bottleneck,
* but unnecessary and simple to avoid. */
static struct {
const char *name;
{0, 0, 0}};
int i;
if (SBUS_IS_STRING_EMPTY(filter)) {
return false;
}
return true;
}
}
return true;
}
return false;
}
void *dp_cli,
const char *filter)
{
return ENOMEM;
}
goto done;
}
dp_req_reply_std, struct dp_reply_std);
done:
}
return ret;
}
struct default_account_domain_state {
};
struct tevent_req *
void *unused_ctx,
struct dp_get_acct_domain_data *data,
struct dp_req_params *params)
{
struct default_account_domain_state);
return NULL;
}
NULL);
return req;
}
struct tevent_req *req,
struct dp_reply_std *data)
{
return EOK;
}