[PATCH] fix spoolss driver version parsing

Jeremy Allison jra at samba.org
Tue Sep 13 21:37:20 UTC 2016


On Tue, Sep 13, 2016 at 04:57:06PM +0200, Günther Deschner wrote:
> Hi,
> 
> we were giving out wrong driver version numbers from the backend.
> 
> please review & push.

LGTM - pushed - thanks !

> -- 
> Günther Deschner                    GPG-ID: 8EE11688
> Red Hat                         gdeschner at redhat.com
> Samba Team                              gd at samba.org

> From 041aeed33d4dd1322ab26ca861b97c6088018b15 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
> Date: Mon, 12 Sep 2016 17:55:37 +0200
> Subject: [PATCH] s3-spoolss: fix winreg_printer_ver_to_qword
> 
> We were reporting the OS minor number as the driver version number in all
> GetDriver/EnumDriver calls.
> 
> Guenther
> 
> Signed-off-by: Guenther Deschner <gd at samba.org>
> ---
>  source3/rpc_client/cli_winreg_spoolss.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/source3/rpc_client/cli_winreg_spoolss.c b/source3/rpc_client/cli_winreg_spoolss.c
> index 37a20ad..f2a91e8 100644
> --- a/source3/rpc_client/cli_winreg_spoolss.c
> +++ b/source3/rpc_client/cli_winreg_spoolss.c
> @@ -529,8 +529,9 @@ static WERROR winreg_printer_write_ver(TALLOC_CTX *mem_ctx,
>  	NTSTATUS status;
>  	char *str;
>  
> -	/* FIXME: check format is right,
> -	 *	this needs to be something like: 6.1.7600.16385 */
> +	/*
> +	 * this needs to be something like: 6.1.7600.16385
> +	 */
>  	str = talloc_asprintf(mem_ctx, "%u.%u.%u.%u",
>  			      (unsigned)((data >> 48) & 0xFFFF),
>  			      (unsigned)((data >> 32) & 0xFFFF),
> @@ -574,7 +575,7 @@ static WERROR winreg_printer_ver_to_qword(const char *str, uint64_t *data)
>  	*data = ((uint64_t)(v1 & 0xFFFF) << 48) +
>  		((uint64_t)(v2 & 0xFFFF) << 32) +
>  		((uint64_t)(v3 & 0xFFFF) << 16) +
> -		(uint64_t)(v2 & 0xFFFF);
> +		(uint64_t)(v4 & 0xFFFF);
>  
>  	return WERR_OK;
>  }
> -- 
> 2.7.4
> 




More information about the samba-technical mailing list