s4:dcesrv_netr_DsRAddressToSitenamesExW - fix the detection of the address family...
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Thu, 17 Jun 2010 07:42:17 +0000 (09:42 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Fri, 18 Jun 2010 08:03:08 +0000 (10:03 +0200)
Obviously the last attempt wasn't enough. Now we do really only read the first
byte in the address buffer which on little endian transmission does always
contain the address family (MS-NRPC 2.2.1.2.4.1).
This should now be working platform-independently.

source4/rpc_server/netlogon/dcerpc_netlogon.c

index b1ac5836f362cb6c1b7d3ae392b68d204d708241..28e517f0c945778efc767cde20007ce22823cdca 100644 (file)
@@ -1695,8 +1695,9 @@ static WERROR dcesrv_netr_DsRAddressToSitenamesExW(struct dcesrv_call_state *dce
                if (r->in.addresses[i].size < sizeof(sa_family_t)) {
                        continue;
                }
-               /* the first two byte of the buffer are the "sin_family" */
-               sin_family = (sa_family_t) *r->in.addresses[i].buffer;
+               /* The first two byte of the buffer are reserved for the
+                * "sin_family" but for now only the first one is used. */
+               sin_family = r->in.addresses[i].buffer[0];
 
                switch (sin_family) {
                case AF_INET: