summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2012-05-14 17:29:12 +0200
committerStephen Gallagher <sgallagh@redhat.com>2012-06-29 11:37:16 -0400
commit04b3ab7658985af749460010123bbe37eccf50ed (patch)
tree9151a43b46ebd644f460278be845cb4c0512f7c4
parent46d3d2c731e8c7e138462e5b60a39a279dc77d81 (diff)
downloadsssd-04b3ab7658985af749460010123bbe37eccf50ed.tar.gz
sssd-04b3ab7658985af749460010123bbe37eccf50ed.tar.bz2
sssd-04b3ab7658985af749460010123bbe37eccf50ed.zip
sudo responder: change protocol version to 1
-rw-r--r--src/responder/sudo/sudosrv_cmd.c9
-rw-r--r--src/sss_client/sss_cli.h2
2 files changed, 10 insertions, 1 deletions
diff --git a/src/responder/sudo/sudosrv_cmd.c b/src/responder/sudo/sudosrv_cmd.c
index 400d4053..911acf6e 100644
--- a/src/responder/sudo/sudosrv_cmd.c
+++ b/src/responder/sudo/sudosrv_cmd.c
@@ -181,6 +181,14 @@ static int sudosrv_cmd(enum sss_dp_sudo_type type, struct cli_ctx *cli_ctx)
return EFAULT;
}
+ /* if protocol is invalid return */
+ if (cli_ctx->cli_protocol_version->version != 1) {
+ DEBUG(SSSDBG_FATAL_FAILURE, ("Invalid protocol! [%d]\n",
+ cli_ctx->cli_protocol_version->version));
+ ret = EFAULT;
+ goto done;
+ }
+
/* parse query */
sss_packet_get_body(cli_ctx->creq->in, &query_body, &query_len);
@@ -244,6 +252,7 @@ static int sudosrv_cmd_get_defaults(struct cli_ctx *cli_ctx)
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"},
{0, NULL, NULL}
};
diff --git a/src/sss_client/sss_cli.h b/src/sss_client/sss_cli.h
index 077111c5..b634e499 100644
--- a/src/sss_client/sss_cli.h
+++ b/src/sss_client/sss_cli.h
@@ -44,7 +44,7 @@ typedef int errno_t;
#define SSS_NSS_PROTOCOL_VERSION 1
#define SSS_PAM_PROTOCOL_VERSION 3
-#define SSS_SUDO_PROTOCOL_VERSION 0
+#define SSS_SUDO_PROTOCOL_VERSION 1
#define SSS_AUTOFS_PROTOCOL_VERSION 1
#define SSS_SSH_PROTOCOL_VERSION 0
#define SSS_PAC_PROTOCOL_VERSION 1