Created attachment 17877 [details]
Samba test binary that shows the issue on 32 bit
socket_wrapper wraps fcntl64 (renamed in socket_wrapper.c from fcntl.h) into fcntl, causing a thunk of the struct flock64 into struct flock64 (it is assumed to be struct flock, eg without _FILE_OFFSET_BITS=64).
It is demonstrated with the attached samba test binary and:
LD_PRELOAD=bin/shared/libsocket-wrapper.so ./bin/test_fcntl foo
This is only seen on Debian 11, not Ubuntu 18.04.
On Ubuntu 18.04 fcntl is not renamed and the wrapping is correctly handled.
Created attachment 17878 [details]
Samba build system patch for demonstration binary
Created attachment 17879 [details]
Partial patch (needs cmake)
This is relative to samba currently.