summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 400d4053b..911acf6e9 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 077111c5b..b634e4995 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