Samba Glibc issues
PELaufer at csupomona.edu
Sun Jan 31 06:25:46 GMT 1999
This is unrelated to my other post about the smbmount daemon. This
is about Glibc 2.0.10x going stable possibly this week and problems
with it and Samba.
Ulrich Drepper, the current Glibc maintainer, announced on
Linux-kernel that he is planning on releasing a new stable version of
Glibc based on the current glibc-2.0.10x development tree, and that he
was ready to do it sometime this week. There are currently some problems
with Samba 2.0 and this libc.
First, Glibc 2.0.10x's strncat function is a macro that actually
uses strcat. Since Samba gets rid of strcat (in order to help prevent
buffer overflows, i presume) Samba wont compile complaining about strcat
is evil - even though there isn't a single strcat in the Samba source. I
fixed this on my box by stealing the strncat() that is done in C from the
Linux kernel. Samba and Linux are GPL so this shoud be ok, right? I also
wrote a configure test to check for this condition and only use the C
strncat if the optimized version included in the libc croaks when strcat
Second, smbumount still uses uid_t. This is a Linux specific
problem and only occurs with Glibc. The deal is that Glibc's uid_t is 32
bits and the kernel's is 16. Smbmount got around this by replacing uid_t
with uint16. That will become a problem soon, as Linux may go to a 32 bit
uid sometime in 2.3, according to the rumors on linux-kernel. I'd suggest
replacing the uint16 and uid_t with __kernel_uid_t, which will be right
for the current kernel. Shouldn't be a problem since smbmount and
smbumount are Linux only anyway. If some other OS grows a smbfs
implementation, then a configure test will be needed.
Third, also related to smbmount, Glibc 2.0.10x's limits.h
undefines NR_OPEN if it wasn't defined before limits.h was included. On my
box I just included linux/limits.h before limits.h to fix this. Again,
this is non-portable, but currently smbmount is Linux only.
That's it as far as I can tell. Nothing really major. I can
provide a patch including these changes if anyone here is interested.
Again, I'm fairly new to this so as much constructive feedback as possible
is wanted and would be put to good use.
Thanks Samba Team!
More information about the samba-technical