problems in Samba 3.0.20rc1

Luke Mewburn lukem at
Mon Aug 1 12:49:13 GMT 2005

Hi all:

I have discovered the following issues in the
that ships with samba 3.0.20rc1:

   1)	Misuses AC_CHECK_HEADERS when testing for
	<rpcsvc/yp_prot.h> and <sys/mode.h>;
	the invocation has a comma in the wrong place.

   2)	Even when 1) is fixed, the macro is not being
	used correctly when checking for <rpcsvc/yp_prot.h>
	(at least on NetBSD, and I suspect that IRIX has a
	similar limitation).
	I've fixed this in the attached patch.

   3)	Because of 1), the check for <sys/mode.h> wasn't
	AFAICT, this header was added for AIX to obtain S_ISLNK(),
	but according to an AIX user I asked, <sys/stat.h> includes
	<sys/mode.h> so it's possible that this header doesn't
	need checking for or including.
	My attached patch retains a (fixed) check for this header
	even though I don't think it's necessary.

   4)	AC_CHECK_HEADERS is misused when checking for
	<security/pam_modules.h>, <net/if.h> and <netinet/ip.h>.
	The reason that Solaris can't detect <security/pam_modules.h>
	is because that header needs <sys/pam_appl.h>
	I've fixed the autoconf check appropriately.
	The reason that Solaris & NetBSD can't detect
	<net/if.h> & <netinet/ip.h> is that various headers
	need to be included first.
	The attached patch fixes these.

   5)	The check for struct timespec assumes that <aio.h> is
	always available, instead of checking HAVE_AIO_H first.
	Fixed in patch.

I'm sure there's other misuses; these are just the ones that I've
found so far.


---	28 Jul 2005 13:19:50 -0000
+++	1 Aug 2005 12:31:38 -0000
@@ -731,8 +731,6 @@ AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(aio.h arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h rpc/nettype.h)
 AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h)
 AC_CHECK_HEADERS(rpc/rpc.h rpcsvc/nis.h rpcsvc/ypclnt.h)
-## These fail to compile on IRIX so just check for their presence
-AC_CHECK_HEADERS(rpcsvc/yp_prot.h, sys/mode.h, [], [] -)
 AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h)
 AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h)
@@ -742,6 +740,15 @@ AC_CHECK_HEADERS(sys/sysmacros.h securit
 AC_CHECK_HEADERS(sys/syslog.h syslog.h execinfo.h)
 AC_CHECK_HEADERS(langinfo.h locale.h)
+#include <rpc/rpc.h>
+## These fail to compile on IRIX so just check for their presence
 # Look for Darwin headers
@@ -784,8 +791,29 @@ AC_CHECK_HEADERS(sys/capability.h syscal
 AC_CHECK_HEADERS(sys/acl.h sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h)
 AC_CHECK_HEADERS(sys/cdefs.h glob.h)
-## These faile to compile on Solaris so just check for their presence
-AC_CHECK_HEADERS(security/pam_modules.h net/if.h netinet/ip.h, [], [], -)
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <security/pam_appl.h>
 # For experimental utmp support (lastlog on some BSD-like systems)
 AC_CHECK_HEADERS(utmp.h utmpx.h lastlog.h)
@@ -929,7 +957,10 @@ AC_CACHE_CHECK([for struct timespec type
 #include <stddef.h>
 #include <time.h>
-#include <aio.h>],[struct timespec ts;],
+#include <aio.h>
+],[struct timespec ts;],
 if test x"$samba_cv_struct_timespec" = x"yes"; then
    AC_DEFINE(HAVE_STRUCT_TIMESPEC,1,[Whether we have struct timespec])
Index: include/
--- include/	28 Jul 2005 17:46:14 -0000
+++ include/	1 Aug 2005 12:31:38 -0000
@@ -1276,6 +1276,9 @@
 /* Define to 1 if you have the <sys/mman.h> header file. */
+/* Define to 1 if you have the <sys/mode.h> header file. */
 /* Define to 1 if you have the <sys/mount.h> header file. */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url :

More information about the samba-technical mailing list