sudosrv_query.c revision 15d41c8f28259061e39715acdbbbaea778b6ecc8
/*
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/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;
}
char **_rawname,
{
char *rawname;
/* uid */
return EINVAL;
}
/* username[@domain] */
return EINVAL;
}
return EINVAL;
}
return EINVAL;
}
return ENOMEM;
}
return EOK;
}