dotted version in rpc interface is broken

Matthieu Patou mat at
Sun Jul 31 16:00:54 MDT 2011


I discovered that the way we handle the dotted version of interface (ie. 
FRSRPC V1.1) is broken.

For instance in bin/default/librpc/gen_ndr/ndr_frsrpc_s.c pidl generate  

const struct dcesrv_interface dcesrv_frsrpc_interface = {
         .name           = "frsrpc",
         .syntax_id  = 
         .bind           = frsrpc__op_bind,
         .unbind         = frsrpc__op_unbind,
         .ndr_pull       = frsrpc__op_ndr_pull,
         .dispatch       = frsrpc__op_dispatch,
         .reply          = frsrpc__op_reply,
         .ndr_push       = frsrpc__op_ndr_push

1.1 is normaly a uint32_t, I guess the complier complains about trying 
to fit a float in a int but at the end do it by casting.

The consequence of it is that all RPC with dotted version won't work 
because when comparing the if_version for the packet and the if_version 
for the registered rpc we have a mismatch due to that cast.

There is a couple of solution for this. The easiest but the most dirty 
is to change the version of dotted rpc, the most clean is to change the 
format of ndr_syntax_id to have 2 uint16_t instead of just one uint32_t 
and to change pidl so that it splits the numbers when there is a dot and 
populate accordingly dcesrv_interface interfaces.

Is there another way not so intrusive ?

Matthieu Patou
Samba Team
Private repo;a=summary

More information about the samba-technical mailing list