/*
Authors:
Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
Copyright (C) 2017 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 "responder/common/cache_req/cache_req_private.h"
struct cache_req_sr_overlay_state {
/* Input data */
/* Work data */
};
struct cache_req_sr_overlay_state *state);
struct cache_req_sr_overlay_state *state);
static struct tevent_req *cache_req_sr_overlay_match_all_step_send(
struct cache_req_sr_overlay_state *state);
static void cache_req_sr_overlay_match_all_step_done(
struct tevent_req *subreq);
struct tevent_context *ev,
struct cache_req_result **results,
{
struct cache_req_sr_overlay_state);
return NULL;
}
/* If session recording is selective */
case CACHE_REQ_USER_BY_NAME:
case CACHE_REQ_USER_BY_UPN:
case CACHE_REQ_USER_BY_ID:
case CACHE_REQ_ENUM_USERS:
/* If we have group names to match against */
/* Pull and match group and user names for each user entry */
"Failed allocating a session recording "
"user overlay request\n");
goto done;
}
} else {
/* Only match user names for each user entry */
}
break;
default:
break;
}
}
done:
} else {
}
}
return req;
}
struct cache_req_sr_overlay_state *state)
{
int lret;
const char *name;
char *output_name;
char **conf_user;
bool enabled;
char *enabled_str;
/* Create per-message talloc context */
"Failed creating temporary talloc context\n");
goto done;
}
/* For each result */
/* For each message */
/* Format output username */
&output_name);
"Failed formatting output username from %s: %s\n",
goto done;
}
/* For each user name in session recording config */
enabled = false;
/* If it matches the requested user name */
enabled = true;
break;
}
}
}
/* Set sessionRecording attribute to enabled value */
if (enabled_str == NULL) {
"Failed to allocate a %s attribute value\n",
goto done;
}
if (lret != LDB_SUCCESS) {
"Failed adding %s attribute: %s\n",
goto done;
}
/* Free per-message allocations */
}
}
done:
return ret;
}
struct cache_req_sr_overlay_state *state)
{
const char *name;
SYSDB_NAME, NULL);
}
static void cache_req_sr_overlay_match_all_step_done(
struct tevent_req *subreq)
{
int lret;
const char *enabled;
/* Create temporary allocation context */
"Failed creating temporary talloc context\n");
goto done;
}
/* Get initgroups result */
"Failed retrieving initgr request results: %s\n",
sss_strerror(ret));
goto done;
}
/* Overwrite sessionRecording attribute */
char *enabled_copy;
if (enabled_copy == NULL) {
"Failed to allocate a copy of %s attribute\n",
goto done;
}
if (lret != LDB_SUCCESS) {
"Failed adding %s attribute: %s\n",
goto done;
}
}
/* Move onto next entry, if any */
goto done;
}
}
/* Schedule next entry overlay */
"Failed allocating a session recording "
"user overlay request\n");
goto done;
}
done:
}
}
{
return EOK;
}