[Pkg-samba-maint] Got one: "smbc_off_t_should_be_at_least_64bits_use_LFS_CFLAGS"

Andreas Hasenack andreas at canonical.com
Fri Jun 3 13:32:47 BST 2022


Hi,

On Tue, May 31, 2022 at 3:20 PM Michael Tokarev <mjt at tls.msk.ru> wrote:
>
> 30.05.2022 22:50, Andreas Hasenack wrote:
> Please note this error is not 100% accurate: a package can be using
> libsmbclient functions which does not operate with off_t (just open/read/
> close), - in this case this error is a false positive, there's no actual
> requirement to use LFS in this case. But unfortunately we can't (easily)
> detect this in libsmbclient.

I filed a bug[1] against libsmbclient-go for it to use LFS_CFLAGS when
building on 32bit architectures, and got an interesting remark in the
PR[2]:

    It seems to me that ideally pkg-config --cflags smbclient would
    DTRT and return -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 along
    with -I/usr/include/samba-4.0. However this is not the case.

And indeed the smbclient.pc file has just the include directory for cflags:
$ cat source3/libsmb/smbclient.pc.in
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: smbclient
Description: A SMB library interface
Version: @PACKAGE_VERSION@
Libs: @LIB_RPATH@ -L${libdir} -lsmbclient
Cflags: -I${includedir}
URL: http://www.samba.org/

Considering that samba won't build[3] without LFS support, shouldn't
this smbclient.pc file have the output of `getconf LFS_CFLAGS` in that
Cflags line? On 32bits systems, that would be the expected
"-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64", and empty on 64bits
systems. There is no guarantee that all projects out there use
pkg-config of course (it's not even a dep of libsmbclient-dev), but
it's another guard we could have in the packaging.

What do you think?



1. https://github.com/mvo5/libsmbclient-go/issues/10
2. https://github.com/mvo5/libsmbclient-go/pull/11#issue-1259602702
3. https://github.com/samba-team/samba/blob/ac16351ff5a0c5b46f461c26516b85e8483bba83/buildtools/wafsamba/wscript#L611



More information about the Pkg-samba-maint mailing list