Bug in Samba4 nttrans handling?

tridge at samba.org tridge at samba.org
Tue Feb 6 23:39:58 GMT 2007


 > To me it seems that the SVAL byte swapping on the setup
 > array is done twice without this patch: Once in the core
 > routines, and once in the NTTRANS wrapper.

Thanks for finding this!

This is an area where "clean design" collides with the stupid layout
of CIFS. The 'clean' change would be to change
smb_raw_changenotify_send() to do something like:

	setup[0] = parms->nttrans.in.completion_filter;
	setup[2] = parms->nttrans.in.file.fnum;
	setup[3] = parms->nttrans.in.recursive;

that would be much more consistent with the rest of the code, as it
would leave the byte swapping in the marshalling layer where it

The problem is that the first setup parameter is a uint32, not a
uint16, so the above won't work. We'd lose half the completion_filter

So I think the best fix will be to change the setup[] array to be a
uint8 array, and stop pretending its a uint16 array. Then the memcpy()
changes in your patch makes sense. Sound OK?

Cheers, Tridge

More information about the samba-technical mailing list