[SCM] Samba Shared Repository - branch v4-0-test updated

Karolin Seeger kseeger at samba.org
Fri Nov 15 05:40:12 MST 2013

The branch, v4-0-test has been updated
       via  c35f22e util: Remove 32bit macros breaking strict aliasing.
       via  ce12995 s3-winbindd: Fix #10264, cache_traverse_validate_fn failure for NDR cache entries.
      from  e76556d Fix bug 10196 - RW Deny for a specific user is not overriding RW Allow for a group.


- Log -----------------------------------------------------------------
commit c35f22eba75c42d544d8f9db03feb2a878e4d232
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Nov 14 18:36:41 2013 +0100

    util: Remove 32bit macros breaking strict aliasing.
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10269
    These macros might have worked but they break strict aliasing in the
    meantime and so the compiler is not able to optimize the relevant code.
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Thu Nov 14 23:16:45 CET 2013 on sn-devel-104
    (cherry picked from commit af69cb2a78810e608ccff115b433801a58a749e4)
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Autobuild-User(v4-0-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-0-test): Fri Nov 15 13:39:05 CET 2013 on sn-devel-104

commit ce12995d4e65e0839b9956b7c2d089b14d6b5cce
Author: Günther Deschner <gd at samba.org>
Date:   Wed Nov 13 15:10:33 2013 +0100

    s3-winbindd: Fix #10264, cache_traverse_validate_fn failure for NDR cache entries.
    We need to increase the keysize limit for NDR queries. A wbint_LookupSids query
    for just 20 sids already hits the older limit.
    Signed-off-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Wed Nov 13 19:33:46 CET 2013 on sn-devel-104
    (cherry picked from commit 944e9fbc20f125b52e047484dca1792d75561ed9)


Summary of changes:
 lib/util/byteorder.h              |   52 +-----------------------------------
 source3/winbindd/winbindd_cache.c |    3 +-
 2 files changed, 4 insertions(+), 51 deletions(-)

Changeset truncated at 500 lines:

diff --git a/lib/util/byteorder.h b/lib/util/byteorder.h
index 6bcf71e..58cd68a 100644
--- a/lib/util/byteorder.h
+++ b/lib/util/byteorder.h
@@ -35,15 +35,6 @@ Here is a description of this file that I emailed to the samba list once:
-The distinction between 386 and other architectures is only there as
-an optimisation. You can take it out completely and it will make no
-difference. The routines (macros) in byteorder.h are totally byteorder
-independent. The 386 optimsation just takes advantage of the fact that
-the x86 processors don't care about alignment, so we don't have to
-align ints on int boundaries etc. If there are other processors out
-there that aren't alignment sensitive then you could also define
-CAREFUL_ALIGNMENT=0 on those processors as well.
 Ok, now to the macros themselves. I'll take a simple example, say we
 want to extract a 2 byte integer from a SMB packet and put it into a
 type called uint16_t that is in the local machines byte order, and you
@@ -130,20 +121,6 @@ static __inline__ void st_le32(uint32_t *addr, const uint32_t val)
-/* we know that the 386 can handle misalignment and has the "right" 
-   byteorder */
-#if defined(__i386__)
 #define CVAL(buf,pos) ((unsigned int)(((const uint8_t *)(buf))[pos]))
 #define CVAL_NC(buf,pos) (((uint8_t *)(buf))[pos]) /* Non-const version of CVAL */
 #define PVAL(buf,pos) (CVAL(buf,pos))
@@ -161,7 +138,7 @@ static __inline__ void st_le32(uint32_t *addr, const uint32_t val)
 #define SSVALS(buf,pos,val) SSVAL((buf),(pos),((int16_t)(val)))
 #define SIVALS(buf,pos,val) SIVAL((buf),(pos),((int32_t)(val)))
+#else /* not HAVE_ASM_BYTEORDER */
 #define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8)
 #define IVAL(buf,pos) (SVAL(buf,pos)|SVAL(buf,(pos)+2)<<16)
@@ -174,32 +151,7 @@ static __inline__ void st_le32(uint32_t *addr, const uint32_t val)
 #define SSVALS(buf,pos,val) SSVALX((buf),(pos),((int16_t)(val)))
 #define SIVALS(buf,pos,val) SIVALX((buf),(pos),((int32_t)(val)))
-#else /* not CAREFUL_ALIGNMENT */
-/* this handles things for architectures like the 386 that can handle
-   alignment errors */
-   WARNING: This section is dependent on the length of int16_t and int32_t
-   being correct 
-/* get single value from an SMB buffer */
-#define SVAL(buf,pos) (*(const uint16_t *)((const char *)(buf) + (pos)))
-#define SVAL_NC(buf,pos) (*(uint16_t *)((void *)((char *)(buf) + (pos)))) /* Non const version of above. */
-#define IVAL(buf,pos) (*(const uint32_t *)((const char *)(buf) + (pos)))
-#define IVAL_NC(buf,pos) (*(uint32_t *)((void *)((char *)(buf) + (pos)))) /* Non const version of above. */
-#define SVALS(buf,pos) (*(const int16_t *)((const char *)(buf) + (pos)))
-#define SVALS_NC(buf,pos) (*(int16_t *)((void *)((char *)(buf) + (pos)))) /* Non const version of above. */
-#define IVALS(buf,pos) (*(const int32_t *)((const char *)(buf) + (pos)))
-#define IVALS_NC(buf,pos) (*(int32_t *)((void *)((char *)(buf) + (pos)))) /* Non const version of above. */
-/* store single value in an SMB buffer */
-#define SSVAL(buf,pos,val) SVAL_NC(buf,pos)=((uint16_t)(val))
-#define SIVAL(buf,pos,val) IVAL_NC(buf,pos)=((uint32_t)(val))
-#define SSVALS(buf,pos,val) SVALS_NC(buf,pos)=((int16_t)(val))
-#define SIVALS(buf,pos,val) IVALS_NC(buf,pos)=((int32_t)(val))
-#endif /* not CAREFUL_ALIGNMENT */
+#endif /* not HAVE_ASM_BYTEORDER */
 /* 64 bit macros */
 #define BVAL(p, ofs) (IVAL(p,ofs) | (((uint64_t)IVAL(p,(ofs)+4)) << 32))
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index f631aea..c463780 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -4060,7 +4060,8 @@ static int cache_traverse_validate_fn(TDB_CONTEXT *the_tdb, TDB_DATA kbuf, TDB_D
 	struct tdb_validation_status *v_state = (struct tdb_validation_status *)state;
 	/* Paranoia check. */
-	if (strncmp("UA/", (const char *)kbuf.dptr, 3) == 0) {
+	if (strncmp("UA/", (const char *)kbuf.dptr, 3) == 0 ||
+	    strncmp("NDR/", (const char *)kbuf.dptr, 4) == 0) {
 		max_key_len = 1024 * 1024;
 	if (kbuf.dsize > max_key_len) {

Samba Shared Repository

More information about the samba-cvs mailing list