From 5e88cb83b1871749ed786fc10600e093ba88d154 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 1 Mar 2007 03:14:20 +0000 Subject: r21614: The memset() called on aligned memory was causing crashes on x86_64 Linux boxes. Since it is not needed, just use malloc() on Linux. (This used to be commit 3644bd999621e04b3fae262f172e93ea8fdcd47e) --- source3/nsswitch/winbindd_cred_cache.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source3/nsswitch') diff --git a/source3/nsswitch/winbindd_cred_cache.c b/source3/nsswitch/winbindd_cred_cache.c index 0847ac9e27..0951a41f33 100644 --- a/source3/nsswitch/winbindd_cred_cache.c +++ b/source3/nsswitch/winbindd_cred_cache.c @@ -494,6 +494,17 @@ static NTSTATUS store_memory_creds(struct WINBINDD_MEMORY_CREDS *memcredp, const memcredp->len += strlen(pass)+1; } +#if defined(LINUX) + /* aligning the memory on on x86_64 and compiling + with gcc 4.1 using -O2 causes a segv in the + next memset() --jerry */ + memcredp->nt_hash = SMB_MALLOC_ARRAY(unsigned char, memcredp->len); +#else + /* On non-linux platforms, mlock()'d memory must be aligned */ + memcredp->nt_hash = SMB_MEMALIGN_ARRAY(unsigned char, + getpagesize(), memcredp->len); +#endif + /* On non-linux platforms, mlock()'d memory must be aligned */ memcredp->nt_hash = SMB_MEMALIGN_ARRAY(unsigned char, psize, -- cgit