dotted version in rpc interface is broken

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


Hello,

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  
this:

const struct dcesrv_interface dcesrv_frsrpc_interface = {
         .name           = "frsrpc",
         .syntax_id  = 
{{0xf5cc59b4,0x4264,0x101a,{0x8c,0x59},{0x08,0x00,0x2b,0x2f,0x84,0x26}},1.1},
         .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        http://samba.org
Private repo      http://git.samba.org/?p=mat/samba.git;a=summary




More information about the samba-technical mailing list