[Samba] unsafe_string_function_usage_here when linking smbd

Kai Lanz lanz at stanford.edu
Tue Jun 3 20:52:16 GMT 2008

I'm trying to build 3.0.30 on Alpha/Tru64-4.0G. The configure step  
but make fails when it tries to link smbd:

Compiling popt/popt.c
Compiling popt/poptconfig.c
Compiling popt/popthelp.c
Compiling popt/poptparse.c
Linking bin/smbd
gmake: *** [bin/smbd] Error 1

This Should Never Happen :) -- that looks like a message for the  
How can I track down the cause of this and fix it?

Here are some details: I'm using the samba-3.0.30.tar.gz source  
downloaded from samba.org. I configured the build as follows:

 > env CC=cc LDFLAGS=-L/local/lib CPPFLAGS=-I/local/include ./ 
configure \
--with-winbind --with-krb5=/local --with-ldap --with-ads

(I have to use the vendor cc, because if I try to build with gcc, I get
the same errors Bengt Nilsson is reporting about tdb_open, _E__lc_ctype,
tdb_traverse, _Eioctl and many others.) Prior to running make, I fixed
what appears to be a typo in the Makefile:

 > diff Makefile Makefile.orig
< LIBSMBSHAREMODES_OBJ = libsmb/smb_share_modes.o $(TDBBASE_OBJ)
 > LIBSMBSHAREMODES_OBJ = libsmb/smb_share_modes.o $(TDB_BASE_OBJ)

Dunno if that's important. Then I ran make like so, using GNU make:

 > limit datasize 1048576
 > limit memoryuse 2041072
 > gmake

The make process begins by reporting (long lines wrapped):

Using FLAGS      =  -I/usr/local/include -O -D_SAMBA_BUILD_=3
-I/src/pub/samba-3.0.30/source/iniparser/src -Iinclude -I./include  - 
I. -I.
-I./lib/replace -I./lib/talloc -I./tdb/include -I./libaddns -I./librpc
-DHAVE_CONFIG_H  -I/usr/local/include -I/local/include -DLDAP_DEPRECATED
-I/src/pub/samba-3.0.30/source/lib -D_SAMBA_BUILD_=3
       PICFLAG    = -fPIC
       LIBS       = -lproplist -lsecurity -lresolv -lresolv
       LDFLAGS    = -L/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib -L/ 
       DYNEXP     =
       LDSHFLAGS  = -shared -L/usr/local/lib -Wl,-rpath -Wl,/usr/ 
       SHLIBEXT   = so
       SONAMEFLAG = -Wl,-soname,
Generating smbd/build_options.c

This dies with the "unresolved" complaint from the linker as shown  
My guess is this is a false-positive from safe_string.h -- i.e., there's
nothing wrong with the string function calls in the smbd source files,
but rather safe_string is mistakenly reporting a problem. Is it possible
to muzzle safe_string and just get on with the build?

I have previously built 3.0.25 successfully on this same Alpha box.
But when I was trying to build 3.0.28 after it came out, I hit the same
"unsafe_string_function_usage" error as I'm now seeing with 3.0.30. At
that time I just gave up; this time I'd like to solve the problem.

Kai Lanz     Stanford University      School of Earth Sciences

More information about the samba mailing list