sudosrv_query.c revision 52300e30a0ec0bbfa1b0918ee0b495f06f5d142a
/*
Authors:
Pavel Březina <pbrezina@redhat.com>
Copyright (C) 2011 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 <string.h>
#include <stdint.h>
#include <errno.h>
#include <talloc.h>
#include <tevent.h>
#include "responder/common/responder_cache_req.h"
#include "responder/sudo/sudosrv_private.h"
const char *str,
{
response_len + (str_len * sizeof(char)));
if (response_body == NULL) {
return ENOMEM;
}
response_len += str_len;
return EOK;
}
{
response_len + sizeof(uint32_t));
if (response_body == NULL) {
return ENOMEM;
}
return EOK;
}
const char *name,
unsigned int values_num,
{
int i = 0;
return ENOMEM;
}
/* attr name */
goto done;
}
/* values count */
goto done;
}
/* values */
for (i = 0; i < values_num; i++) {
goto done;
}
goto done;
}
}
done:
return ret;
}
int attrs_num,
struct ldb_message_element *attrs,
{
int i = 0;
return ENOMEM;
}
/* attrs count */
goto done;
}
/* attrs */
for (i = 0; i < attrs_num; i++) {
goto done;
}
}
done:
return ret;
}
/*
* Response format:
* <error_code(uint32_t)><domain(char*)>\0<num_entries(uint32_t)><rule1><rule2>...
* <ruleN> = <num_attrs(uint32_t)><attr1><attr2>...
* <attrN> = <name(char*)>\0<num_values(uint32_t)><value1(char*)>\0<value2(char*)>\0...
*
* if <error_code> is not SSS_SUDO_ERROR_OK, the rest of the data is skipped.
*/
struct sysdb_attrs **rules,
{
size_t response_len = 0;
uint32_t i = 0;
return ENOMEM;
}
/* error code */
goto fail;
}
if (error != SSS_SUDO_ERROR_OK) {
goto done;
}
/* domain name - deprecated
* TODO: when possible change the protocol */
goto fail;
}
/* rules count */
goto fail;
}
/* rules */
for (i = 0; i < rules_num; i++) {
goto fail;
}
}
done:
fail:
return ret;
}
struct sudosrv_parse_query_state {
char *username;
struct sss_domain_info *domain;
};
{
size_t rawname_len = 0;
/* create request */
struct sudosrv_parse_query_state);
return NULL;
}
/* uid */
goto immediately;
}
/* username[@domain] */
goto immediately;
}
goto immediately;
}
goto immediately;
}
/* parse username */
sudo_ctx->neg_timeout, 0,
goto immediately;
}
return req;
} else {
}
return req;
}
{
struct sudosrv_parse_query_state *state;
struct tevent_req *req;
return;
}
}
struct tevent_req *req,
char **_username,
struct sss_domain_info **_domain)
{
return EOK;
}