Request: please hide or rename set_variable function
asn at samba.org
Tue Feb 9 16:05:02 UTC 2016
On Tuesday 09 February 2016 14:23:28 Philipp Klenze wrote:
> Dear all,
> I would like to ask you to change the name of the function set_variable
> 1672 to something more unique.
> I have just debugged code by someone who was using the same function
> name in his own code. When he called gethostbyname(),
> libsamba-hostconfig.so.0 was loaded by libc due to a nsswitch setting.
> Rather sooner than later, the library tried to run set_variable.
> Naturally, it ran the wrong one, which expected a very different call
> stack and everything ended with a segfault.
> I think everyone understands naming ones local functions fprintf,
> __libc_malloc or the like is asking for trouble. But set_variable? There
> is no clue at all for the user that function name might be forbidden, no
> manpage entry, nothing. Even using ldd and nm to find out all defined
> symbols in every linked library would not help, as libsamba-hostconfig
> seems to be loaded on demand by libc.
> As this particular function name is one other programmers out there
> might use as well, would you please change it?
The functions is static in 4.4.
asn at magrathea:~/workspace/projects/samba> git tag --contains
Andreas Schneider GPG-ID: CC014E3D
Samba Team asn at samba.org
More information about the samba-technical