ifpsrv_cmd.c revision 11a87c5f091d6c092b5dadd3d67f900213e280da
/*
Authors:
Jakub Hrozek <jhrozek@redhat.com>
Copyright (C) 2013 Red Hat
InfoPipe responder: the responder commands
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/ifp/ifp_private.h"
#include "responder/common/responder_cache_req.h"
struct ifp_attr_req {
const char *name;
const char **attrs;
int nattrs;
};
static struct tevent_req *
struct sss_nc_ctx *ncache,
enum sss_dp_acct_type search_type,
struct tevent_req *req,
struct ldb_result **_res,
struct sss_domain_info **_domain);
static errno_t
const char **attrs,
struct ldb_result *res);
static errno_t
{
struct ifp_attr_req *attr_req;
struct tevent_req *req;
"switching to org.freedesktop.sssd.infopipe.Users.User interface\n");
}
}
}
return ret; /* internal error */
}
}
return EOK;
}
static errno_t
{
bool parsed;
char **attrs;
int nattrs;
int i, ai;
if (parsed == false) {
return ERR_SBUS_REQUEST_HANDLED;
}
/* Copy the attributes to maintain memory hierarchy with talloc */
return ENOMEM;
}
ai = 0;
for (i = 0; i < nattrs; i++) {
"Attribute %s not present in the whitelist, skipping\n",
attrs[i]);
continue;
}
return ENOMEM;
}
ai++;
}
return EOK;
}
{
struct ifp_attr_req *attr_req;
"No such user\n"));
return;
"Failed to read user attribute\n"));
return;
}
"Failed to build a reply\n"));
return;
}
}
static errno_t
struct ldb_message_element *el,
const char sub)
{
int i;
for (i = 0; i < el->num_values; i++) {
sub);
return ENOMEM;
}
}
return EOK;
}
static errno_t
const char **attrs,
struct ldb_result *res)
{
struct ldb_message_element *el;
int ai;
/* Construct a reply */
if (!reply) {
}
&iter_dict);
if (!dbret) {
}
"Attribute %s not present or has no values\n",
continue;
}
/* Normalize white space in user names */
continue;
}
}
"Cannot add attribute %s to message\n",
continue;
}
}
}
if (!dbret) {
}
}
struct ldb_result *res);
{
struct ifp_attr_req *group_req;
struct tevent_req *req;
}
}
}
}
}
}
return EOK;
}
{
struct ifp_attr_req *group_req;
struct ldb_result *res;
struct sss_domain_info *dom;
"No such user\n"));
return;
"Failed to read attribute\n"));
return;
}
"Failed to build a reply\n"));
return;
}
}
static errno_t
struct ldb_result *res)
{
int i, num;
const char *name;
const char **groupnames;
const char *tmpstr;
/* one less, the first one is the user entry */
if (groupnames == NULL) {
}
for (i = 0; i < num; i++) {
SYSDB_NAME, NULL);
continue;
}
continue;
}
} else {
}
if (groupnames[i] == NULL) {
"sss_get_cased_name failed, skipping\n");
continue;
}
}
}
struct ifp_user_get_attr_state {
const char *inp;
const char **attrs;
struct ldb_result *res;
enum sss_dp_acct_type search_type;
char *name;
char *domname;
struct sss_domain_info *dom;
bool check_next;
bool check_provider;
struct sss_nc_ctx *ncache;
};
static struct tevent_req *
struct sss_nc_ctx *ncache,
enum sss_dp_acct_type search_type,
{
struct tevent_req *req;
struct tevent_req *subreq;
struct ifp_user_get_attr_state *state;
return NULL;
}
goto done;
}
done:
}
return req;
}
static void
{
struct cache_req_data *data;
return;
}
switch (state->search_type) {
case SSS_DP_USER:
break;
case SSS_DP_INITGROUPS:
break;
default:
state->search_type);
return;
}
return;
}
return;
}
}
{
return;
}
/* throw away the result and perform attr search */
return;
return;
"returned more than one result!\n");
return;
}
}
}
static errno_t
struct tevent_req *req,
struct ldb_result **_res,
struct sss_domain_info **_domain)
{
struct ifp_user_get_attr_state);
/* Did the request end with success but with no data? */
return ENOENT;
}
if (_res) {
}
if (_domain) {
}
return EOK;
}
struct cli_protocol_version *register_cli_protocol_version(void)
{
static struct cli_protocol_version ssh_cli_protocol_version[] = {
};
return ssh_cli_protocol_version;
}
/* This is a throwaway method to ease the review of the patch.
* It will be removed later */
{
static const char *pong = "PONG";
const char *request;
}
}
return EOK; /* handled */
}
"Ping() only accepts ping as a param\n");
}
}