sudosrv_query.c revision 46d3d2c731e8c7e138462e5b60a39a279dc77d81
/*
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 "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(int));
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.
*/
const char *domain,
int rules_num,
struct sysdb_attrs **rules,
{
size_t response_len = 0;
int i = 0;
return ENOMEM;
}
/* error code */
goto fail;
}
if (error != SSS_SUDO_ERROR_OK) {
goto done;
}
/* domain name */
goto fail;
}
/* rules count */
goto fail;
}
/* rules */
for (i = 0; i < rules_num; i++) {
goto fail;
}
}
done:
fail:
return ret;
}
/*
* Query format:
* <uid><username[@domain]>
*/
char **_username,
struct sss_domain_info **_domain)
{
size_t rawname_len = 0;
char *domainname = NULL;
return ENOMEM;
}
/* uid */
goto done;
}
/* username[@domain] */
goto done;
}
goto done;
}
goto done;
}
/* parse username */
&domainname, &username);
goto done;
}
if (domainname != NULL) {
/* mem_ctx because it duplicates only subdomains not domains
* so I cannot easily steal it */
goto done;
}
}
done:
return ret;
}