[SSSD] [PATCH] sudo: do not hardcode protocol version

Jakub Hrozek jhrozek at redhat.com
Tue Oct 30 12:38:13 UTC 2012


On Tue, Oct 30, 2012 at 01:27:50PM +0100, Pavel Březina wrote:

> From a6182a234b1bef9b9c4ab8fc6b925504c0135f69 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina at redhat.com>
> Date: Tue, 30 Oct 2012 12:03:19 +0100
> Subject: [PATCH 1/2] sudo: do not hardcode protocol version
> 
> ---
>  src/responder/sudo/sudosrv_cmd.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/responder/sudo/sudosrv_cmd.c b/src/responder/sudo/sudosrv_cmd.c
> index 13eb4991f318f0e9824dbeb5fc80f069c476e28c..9a87ed7d768b0bf35b1d1980895d08e4cf08d5f7 100644
> --- a/src/responder/sudo/sudosrv_cmd.c
> +++ b/src/responder/sudo/sudosrv_cmd.c
> @@ -27,6 +27,7 @@
>  #include "responder/common/responder_packet.h"
>  #include "responder/sudo/sudosrv_private.h"
>  #include "db/sysdb_sudo.h"
> +#include "sss_client/sss_cli.h"
>  
>  static errno_t sudosrv_cmd_send_reply(struct sudo_cmd_ctx *cmd_ctx,
>                                        uint8_t *response_body,
> @@ -182,7 +183,7 @@ static int sudosrv_cmd(enum sss_sudo_type type, struct cli_ctx *cli_ctx)
>      }
>  
>      /* if protocol is invalid return */
> -    if (cli_ctx->cli_protocol_version->version != 1) {
> +    if (cli_ctx->cli_protocol_version->version != SSS_SUDO_PROTOCOL_VERSION) {
>          DEBUG(SSSDBG_FATAL_FAILURE, ("Invalid protocol! [%d]\n",
>                cli_ctx->cli_protocol_version->version));
>          ret = EFAULT;
> -- 
> 1.7.11.7
> 

How is the sudo protocol version handled on the sudo side? Are we able
to handle the "previous" tech-preview protocol gracefully? What if we
decide to change the protocol again?



More information about the sssd-devel mailing list