Closed phlogistonjohn closed 2 years ago
We can certainly do that but I am wondering why the CP850 codepage (which is typically compiled in) is not available in the first place.
Let me know if there are any commands we can run to investigate. Otherwise, I'd like to try and squish the annoying message and then we can open a new issue to investigate deeper.
We can certainly do that but I am wondering why the CP850 codepage (which is typically compiled in) is not available in the first place.
I dug into this little deeper and here are my findings:
CP850 and IBM850 can be used interchangeably as they are aliases to each other.
charset detection is mostly driven by an on-demand initialization function _get_convhandle() in Samba which basically attempts to find DEFAULT_DOS_CHARSET
(CP850) unless explicitly specified via dos charset
smb.conf option. DEFAULT_DOS_CHARSET
is a compile/build time macro defined to indicate the charset found. Further in its absence DEFAULT_DOS_CHARSET
is set to ASCII.
I verified using sample program that independent library files, in this case for IBM850, are required for individual charsets. In Fedora glibc-gconv-extra package provides IBM850.so. Even though Samba rpms are built with IBM850 our smbclient images based on CentOS Stream 8(and server images based on Fedora 35 too) doesn't have this package installed by default and thus we end up with the warning for smbclient
(and in server logs).
Wow. Love the in depth analysis @anoopcs9. Between all that, and this seems very much an smb1 thing I'm strongly in favor of suppressing the error message by defaulting to ascii. Hopefully as samba continues to deprecate/drop support for smb1 this goes away entirely.
In the meantime I'm planning on merging #229 later today unless I hear some clear NAKs.
@anoopcs9 Impressive!
Tools like smbclient and net are generating dos charset warnings when run. Looks somewhat like:
It's minor but unnecessary as it can be eliminated by setting an smb.conf option (
dos charset
AFAICT). Let's set that option and eliminate an annoyance.