[PATCH] fix display of REG_DWORD in spoolss rpcclient

Jeremy Allison jra at samba.org
Fri May 5 05:44:58 UTC 2017


On Thu, May 04, 2017 at 11:44:50AM +0200, Günther Deschner via samba-technical wrote:
> Hi,
> 
> please review and push.

Doesn't this then only print the first 4 bytes of the blob.
If it's bigger, shouldn't we be printing all of it ?

Just curious.

Jeremy.

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

> From 6f8fd87e78e3a61feeae66219176c812f63acc3e Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
> Date: Wed, 3 May 2017 11:31:20 +0200
> Subject: [PATCH] s3-rpcclient: Fix enumdata spoolss display of REG_DWORD
> 
> One should not assume a REG_DWORD is always 4 byte long.
> 
> Guenther
> 
> Signed-off-by: Guenther Deschner <gd at samba.org>
> ---
>  source3/rpcclient/cmd_spoolss.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
> index e5077d5..b7cdd5b 100644
> --- a/source3/rpcclient/cmd_spoolss.c
> +++ b/source3/rpcclient/cmd_spoolss.c
> @@ -770,7 +770,7 @@ static void display_reg_value(const char *name, enum winreg_Type type, DATA_BLOB
>  
>  	switch(type) {
>  	case REG_DWORD:
> -		if (blob.length == sizeof(uint32_t)) {
> +		if (blob.length >= sizeof(uint32_t)) {
>  			printf("%s: REG_DWORD: 0x%08x\n", name, IVAL(blob.data,0));
>  		} else {
>  			printf("%s: REG_DWORD: <invalid>\n", name);
> -- 
> 2.9.3
> 






More information about the samba-technical mailing list