source: branches/2.3.7/fon/samba3/patches/280-big-endian-fix.patch @ 2343

Last change on this file since 2343 was 2343, checked in by matthijs, 6 years ago

Backport r2342: samba3: Properly set endianness 2.0g

Apparently before Samba was always compiled for little-endian
architectures. Samba uses htons() and friends for its network protocol
and doesn't care much for endianness otherwise, except when dealing with
UCS2 strings. In particular, the uppercasing/lowercasing of strings
wouldn't work properly on big endian systems (2.0g).

The most visible effect of this was that NTLMv2 authentication didn't
work. Since Windows Vista and upwards default to NTMLv2, all passwords
would be rejected coming from those platforms. Also, recent Linux
versions seem to use NTLMv2 by default. The NTLMv1 authentication
apparently didn't use this UCS2 functions, so connecting from Windows XP
and below was unaffected.

References: #1325

File size: 444 bytes
  • source/include/config.h

    Make sure that Samba knows if our platform is big endian.
    a b  
    19861986/* Define to 1 if your processor stores words with the most significant byte
    19871987   first (like Motorola and SPARC, unlike Intel and VAX). */
    1988 /* #undef WORDS_BIGENDIAN */
     1988#if __BYTE_ORDER == __BIG_ENDIAN
     1989#define WORDS_BIGENDIAN 1
    19901992/* Required alignment */
    19911993/* #undef _ALIGNMENT_REQUIRED */
Note: See TracBrowser for help on using the repository browser.