[Pkg-samba-maint] Bug#974868: samba-vfs-modules: Still causing issues - at least on armv5tel/armel

Michael Tokarev mjt at tls.msk.ru
Thu Nov 17 12:57:33 GMT 2022


17.11.2022 14:09, ArtMG wrote:
>> Please check if 4.16 fixes this. If not, I guess the best course is to
>> switch to a 64bit system, since apparently samba is having inherent
>> issues on 32bit systems.
> 
> I have now reproduced the error on 4.13.13 on 32bit, and confirmed it is *still* an issue with 4.16.7 on 32bit. However when I switch to 64bit OS version, the error does *not* occur, not even in 4.13.13. The TimeMachine client successfully mounts the share and completes multiple backups, and the server smbd logs are clean, with no overflow warnings, and definitely no "Invalid or incomplete multibyte or wide character" errors.

I looked at the source of vfs_fruit module.
It looks to me this whole thing is just trivial really.

First, they use system off_t type for internal thing.  It is
not used for actual system functions which expect an offset in
a file, it is used internally and/or in the protocol, in particular
to report disk free space, - there, an off_t should not be used.
For this reason, something like u_int64_t (or u_int_least64_t)
type should be used instead of off_t with an unknown size.

And second, when samba is built, LFS (large file support) should
be enabled, so off_t should already be 64bits.

To me it looks like somewhat questionable programming habits.

For an uint type, something like ~((uint64_t)0) (I havn't done
much programming in some 10 years - something *like* that) should
give you the maximum value this type can ever hold, - that's
SIZE_MAX for you.

I'm not sure what this very test gives you in the first place.
the max size *should* be able to hold a 64bit integer.

FWIW.

/mjt



More information about the Pkg-samba-maint mailing list