[PATCH] s3: set native os according to Windows and NBT_ANNOUNCE_VERSION defines

Andrew Bartlett abartlet at samba.org
Tue Jan 7 11:37:29 MST 2014


On Tue, 2014-01-07 at 15:57 +0100, Björn Jacke wrote:
> When the native os in sessionsetup is "Unix" then broken Konica Minolta
> printers refuse to talk to those CIFS servers. Other CIFS servers also announce
> themselves with native os Windows. Let's do the same to improve
> interoperability with broken devices like those printers from Konica Minolta.
> Thanks to Daniel Hoffmann for finding and reporting this Konika printer
> brokenness.
> 
> This fixes Bug #10168.

I do worry what the engineer that deliberately added this insane check
will add next (such as checking the next string, which I would be much
more worried about changing, due to loss of debugging).  However, I'm
not objecting to the concept. 

> Signed-off-by: Bjoern Jacke <bj at sernet.de>
> ---
>  source3/smbd/sesssetup.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
> index 4728759..02cb445 100644
> --- a/source3/smbd/sesssetup.c
> +++ b/source3/smbd/sesssetup.c
> @@ -46,10 +46,14 @@ static int push_signature(uint8 **outbuf)
>  {
>  	char *lanman;
>  	int result, tmp;
> +	fstring native_os;
>  
>  	result = 0;
>  
> -	tmp = message_push_string(outbuf, "Unix", STR_TERMINATE);
> +	fstr_sprintf(native_os, "Windows %d.%d", SAMBA_MAJOR_NBT_ANNOUNCE_VERSION,
> +		SAMBA_MINOR_NBT_ANNOUNCE_VERSION);
> +
> +	tmp = message_push_string(outbuf, native_os, STR_TERMINATE);
>  
>  	if (tmp == -1) return -1;
>  	result += tmp;

Can you please at least match the next string and asprintf it, or move
both to talloc_asprintf?  In general, we were trying to move away from
fstring to talloc strings. 

Thanks,

Andrew Bartlett

-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba




More information about the samba-technical mailing list