sudosrv_cmd.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 <stdint.h>
#include <errno.h>
#include <talloc.h>
#include "responder/common/responder.h"
#include "responder/common/responder_packet.h"
#include "responder/sudo/sudosrv_private.h"
#include "db/sysdb_sudo.h"
#include "sss_client/sss_cli.h"
#include "responder/common/negcache.h"
{
size_t packet_len = 0;
"Unable to create a new packet [%d]; %s\n",
goto done;
}
goto done;
}
done:
return ret;
}
struct sudo_cmd_ctx *cmd_ctx,
{
size_t response_len = 0;
"returning error?\n");
return EFAULT;
}
return ret;
}
}
{
size_t response_len = 0;
switch (ret) {
case EOK:
/*
* Parent of cmd_ctx->rules is in-memory cache, we must not talloc_free it!
*/
/* filter rules by time */
return EFAULT;
}
}
/* send result */
return EFAULT;
}
break;
case EAGAIN:
/* async processing, just return here */
return EOK;
case EFAULT:
/* very bad error */
return EFAULT;
/* case ENOENT:
* - means user not found
* - send error ENOENT
*/
default:
/* send error */
break;
}
return EFAULT;
}
return EOK;
}
{
/* create cmd_ctx */
/* kill the connection here as we have no context for reply */
return ENOMEM;
}
return EFAULT;
}
/* if protocol is invalid return */
switch (protocol) {
case 0:
"SSSD does not allow to use this protocol.\n", protocol);
goto done;
break;
protocol);
break;
default:
protocol);
goto done;
}
/* parse query */
goto done;
}
goto done;
}
done:
}
{
goto done;
}
case SSS_SUDO_DEFAULTS:
break;
case SSS_SUDO_USER:
break;
}
done:
}
{
}
{
}
struct cli_protocol_version *register_cli_protocol_version(void)
{
static struct cli_protocol_version sudo_cli_protocol_version[] = {
{1, "2012-05-14", "require uid and domain"},
};
return sudo_cli_protocol_version;
}
struct sss_cmd_table *get_sudo_cmds(void) {
static struct sss_cmd_table sudo_cmds[] = {
{SSS_CLI_NULL, NULL}
};
return sudo_cmds;
}