Samba 2.0 Beta1 released !

Andrej Borsenkow borsenkow.msk at
Mon Nov 16 11:34:17 GMT 1998

> I've also attached a patch I'd like to see included to adress the fact
> that some vendors have changed the socket API so that call-by-reference
> parameters that give buffer lengths are not int.

Unfortunately, the patch as is is wrong. It unconditionally resets agrument
to size_t. In our case e.g., the system provides two environments (32 bits
and 64 bits); the argument is size_t in 32 bits case, and int in 64 bits
case. Setting it to size_t in 64bit environment will break all possible
things (size_t is 64 bit long in this case). The test for ostype is porbably
too generic to handle such things.

Perl does the same check for several socket functions. The idea is as

#include <sys/socket.h>

int getsockopt(int socket,
                int level,
                int option_name,
                void *option_value,
                size_t *option_len)

With well-behaving C-Compiler this code will *not* compile, because of
prototype mismatch, which is unconditional error in ANSI (if option_len has
int * type).

BTW you test for strncasecmp in -lresolv in case of SVR4.2. Our system is
autoconf'ed as mips-sni-sysv4, but still has str[n]casecmp in -resolv as
well. May be, test just for *sysv4*?


More information about the samba-technical mailing list