Add fix for incorrect mapping of fcntl64() -> fcntl(), causing locking failures
authorAndrew Bartlett <abartlet@samba.org>
Fri, 5 May 2023 01:34:00 +0000 (13:34 +1200)
committerAndreas Schneider <asn@samba.org>
Mon, 8 May 2023 10:34:59 +0000 (12:34 +0200)
commitdf918708717c084ec9048be2864edcde81816108
treef8219e1dbb66f83564d86d8e2052eadca029753c
parentceb139dc42c50275a11ca974ef8800032cf24b6f
Add fix for incorrect mapping of fcntl64() -> fcntl(), causing locking failures

We need to call fcntl64() if possible for 32-bit hosts

This is a strange case of socket_wrapper breaking normal file operation.

Newer glibc has introduced fcntl64 and symbol renaming but
the end function call was not caught by the automatic rename.

This means socket_wrapper would call fcntl(), not fcntl64 in libc
and this would do a "struct flock" -> "struct flock64" translation on the
supplied argument, despite this being already a flock64 from
the caller.

This in turn changed the lock offset values (eg to 0, 0).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15367

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
ConfigureChecks.cmake
src/socket_wrapper.c