[Pkg-samba-maint] Bug#221618: Bug#221618: Bug#221618: Advice on #221618 (libsmbclient-dev: 64bits prototype not precised)

Andrew Bartlett abartlet at samba.org
Fri May 3 19:55:25 UTC 2013


On Thu, 2011-06-16 at 07:35 +0200, Christian PERRIER wrote:
> Quoting Steve Langasek (vorlon at debian.org):
> 
> > You're perfectly right that this is an imperfect solution.  A correct
> > upstream solution would be to define private "off_t" types like the ones in
> > zlib, and export those as the interface instead of off_t itself.  But in the
> > meantime, I think this change is the closest we can get to correct behavior
> > in the distro, and doesn't break anything not already broken.
> 
> 
> So, it make it short, we can add this patch but should keep it as
> Debian-specific. I'll include it, then, and will mention in the
> headers that it is Debian specific.
> 
> From your comments, I understand this still warrants an upstream bug
> report...which you actually half-wrote above..:-)

In looking over this patch while working to merge the Samba packages, I
wish to re-raise my discomfort with this patch.  Indeed, I think it
simply moves the dangerous situation to within the program building
against Samba (ie any internal interface specified with off_t, which
isn't built including libsmbclient.h is in the same situation as
programs built against libsmbclient.h are now.)

I think, the correct solution is to extend the Cflags line in the
smbclient.pc file to include -D_LARGEFILE64_SOURCE -D
_FILE_OFFSET_BITS=64 or whatever we found as the right flags.
Annoyingly in this, we decided not to use CFLAGS for this, but #defines
in config.h, so we are going to have to have both collected.

However, nothing will stop a user from attempting to compile against
libsmbclient without looking at smbclient.pc.  The only thing I can
suggest is to somehow have it fail to build if sizeof(off_t) < 8, which
would be the rest of the general solution.

Andrew Bartlett


-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org






More information about the Pkg-samba-maint mailing list