[PATCH] smbcontrol smbd ping

Volker Lendecke Volker.Lendecke at SerNet.DE
Fri Aug 21 03:43:39 MDT 2009

On Thu, Aug 20, 2009 at 10:32:37AM +0200, Olaf Flebbe wrote:
> 2) smbcontrol <largeinteger> ping
> triggers weird behaviour. try 2147483649 for instance.

Thanks for your patch! I've read in susv3 about pid_t, and
indeed it is supposed to be a signed type. But I could not
read anything about it actually being an "unsigned int".

According to the spec it might for example be a short.
Passing a pointer to a short to sscanf would make sscanf
overflow the variable. I think we need to change the 

        unsigned int vnn, pid;


        int pid;
        unsigned int vnn;

instead of having "pid_t pid".

The assignment later on (result.pid = pid) will do the
automatic type-conversion that taking a pointer of a pid_t
could not do.

Can you supply a new patch with that?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20090821/e4e242f4/attachment.pgp>

More information about the samba-technical mailing list