diff options
author | Gerald Carter <jerry@samba.org> | 2007-03-01 03:14:20 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:18:17 -0500 |
commit | 5e88cb83b1871749ed786fc10600e093ba88d154 (patch) | |
tree | 71e729d8d009e3014ada6c0137cf0f0005380f85 | |
parent | aaa3a9a329b2a47c44b3a26baabdfe0668224ffe (diff) | |
download | samba-5e88cb83b1871749ed786fc10600e093ba88d154.tar.gz samba-5e88cb83b1871749ed786fc10600e093ba88d154.tar.bz2 samba-5e88cb83b1871749ed786fc10600e093ba88d154.zip |
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)
-rw-r--r-- | source3/nsswitch/winbindd_cred_cache.c | 11 |
1 files changed, 11 insertions, 0 deletions
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, |