[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1113-g31120c9

Jelmer Vernooij jelmer at samba.org
Mon Apr 20 14:26:37 GMT 2009


The branch, master has been updated
       via  31120c9eacafd93e0f2c6b0f906af21adadd318a (commit)
       via  bb0f43006403106fda6231ef9b5c9674ebb53e14 (commit)
       via  20e1ba1c09631a3b1c850d9c8cbb42d863d0cb39 (commit)
       via  e5233ccf9e32cd5d399f91512d7f310d43558e31 (commit)
       via  fbf4293d7ec80b93d2b289698f85641dbf26750a (commit)
      from  a6cb47089207991e7128f895f927a8d51a1d5c7a (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 31120c9eacafd93e0f2c6b0f906af21adadd318a
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Apr 20 16:22:44 2009 +0200

    Move syslog check out of m4 library file into configure.in

commit bb0f43006403106fda6231ef9b5c9674ebb53e14
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Apr 20 15:54:02 2009 +0200

    Error out at runtime when seteuid/setresuid or setegid/setresgid are not
    available. This means it's possible to compile libreplace when these
    functions are not available and use it, as long as this particular
    function is not used.

commit 20e1ba1c09631a3b1c850d9c8cbb42d863d0cb39
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Apr 20 15:47:19 2009 +0200

    Only define waitpid replacement if wait4 is available. (It isn't on
    Windows.)

commit e5233ccf9e32cd5d399f91512d7f310d43558e31
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Apr 20 15:39:48 2009 +0200

    Cope with the fact that only _mkdir() exists on Windows and that it
    doesn't take a mode argument.

commit fbf4293d7ec80b93d2b289698f85641dbf26750a
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Apr 20 15:21:39 2009 +0200

    Move check for syslog out of libreplace to source3/ and source4/.
    
    This should help compiling talloc on Windows.

-----------------------------------------------------------------------

Summary of changes:
 lib/replace/libreplace.m4     |    4 ++--
 lib/replace/replace.c         |   12 +++++++++---
 lib/replace/samba.m4          |    2 ++
 lib/replace/system/filesys.h  |    4 ++++
 lib/replace/system/wait.h     |    4 ++++
 lib/replace/test/os2_delete.c |    4 ++++
 source3/configure.in          |    1 +
 source3/m4/aclocal.m4         |    2 +-
 8 files changed, 27 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/replace/libreplace.m4 b/lib/replace/libreplace.m4
index 30d7017..2d90d9c 100644
--- a/lib/replace/libreplace.m4
+++ b/lib/replace/libreplace.m4
@@ -106,7 +106,7 @@ AC_CHECK_HEADERS(stropts.h)
 
 AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror)
 AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename)
-AC_CHECK_FUNCS(waitpid strlcpy strlcat initgroups memmove strdup)
+AC_CHECK_FUNCS(waitpid wait4 strlcpy strlcat initgroups memmove strdup)
 AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp dup2)
 AC_CHECK_FUNCS(isatty chown lchown link readlink symlink realpath)
 AC_HAVE_DECL(setresuid, [#include <unistd.h>])
@@ -279,7 +279,7 @@ m4_include(timegm.m4)
 m4_include(repdir.m4)
 m4_include(crypt.m4)
 
-AC_CHECK_FUNCS([syslog printf memset memcpy],,[AC_MSG_ERROR([Required function not found])])
+AC_CHECK_FUNCS([printf memset memcpy],,[AC_MSG_ERROR([Required function not found])])
 
 echo "LIBREPLACE_BROKEN_CHECKS: END"
 ]) dnl end AC_LIBREPLACE_BROKEN_CHECKS
diff --git a/lib/replace/replace.c b/lib/replace/replace.c
index 78c688d..fc15717 100644
--- a/lib/replace/replace.c
+++ b/lib/replace/replace.c
@@ -31,6 +31,10 @@
 #include "system/locale.h"
 #include "system/wait.h"
 
+#ifdef _WIN32
+#define mkdir(d,m) _mkdir(d)
+#endif
+
 void replace_dummy(void);
 void replace_dummy(void) {}
 
@@ -355,7 +359,7 @@ char *rep_strndup(const char *s, size_t n)
 }
 #endif
 
-#ifndef HAVE_WAITPID
+#if !defined(HAVE_WAITPID) && defined(HAVE_WAIT4)
 int rep_waitpid(pid_t pid,int *status,int options)
 {
   return wait4(pid, status, options, NULL);
@@ -368,7 +372,8 @@ int rep_seteuid(uid_t euid)
 #ifdef HAVE_SETRESUID
 	return setresuid(-1, euid, -1);
 #else
-#  error "You need a seteuid function"
+	errno = ENOSYS;
+	return -1;
 #endif
 }
 #endif
@@ -379,7 +384,8 @@ int rep_setegid(gid_t egid)
 #ifdef HAVE_SETRESGID
 	return setresgid(-1, egid, -1);
 #else
-#  error "You need a setegid function"
+	errno = ENOSYS;
+	return -1;
 #endif
 }
 #endif
diff --git a/lib/replace/samba.m4 b/lib/replace/samba.m4
index ccb6f2e..4514728 100644
--- a/lib/replace/samba.m4
+++ b/lib/replace/samba.m4
@@ -33,3 +33,5 @@ SMB_SUBSYSTEM(LIBREPLACE_HOSTCC,
 	[${LIBREPLACE_HOSTCC_OBJS}],
 	[],
 	[-Ilib/replace])
+
+AC_CHECK_FUNCS([syslog],,[AC_MSG_ERROR([Required function not found])])
diff --git a/lib/replace/system/filesys.h b/lib/replace/system/filesys.h
index 4bf1f64..1cf6f23 100644
--- a/lib/replace/system/filesys.h
+++ b/lib/replace/system/filesys.h
@@ -179,4 +179,8 @@
 #define SEEK_SET 0
 #endif
 
+#ifdef _WIN32
+#define mkdir(d,m) _mkdir(d)
+#endif
+
 #endif
diff --git a/lib/replace/system/wait.h b/lib/replace/system/wait.h
index 5784b1a..79583ad 100644
--- a/lib/replace/system/wait.h
+++ b/lib/replace/system/wait.h
@@ -52,4 +52,8 @@
 typedef int sig_atomic_t;
 #endif
 
+#if !defined(HAVE_WAITPID) && defined(HAVE_WAIT4)
+int rep_waitpid(pid_t pid,int *status,int options)
+#endif
+
 #endif
diff --git a/lib/replace/test/os2_delete.c b/lib/replace/test/os2_delete.c
index 44efeea..8b52837 100644
--- a/lib/replace/test/os2_delete.c
+++ b/lib/replace/test/os2_delete.c
@@ -27,6 +27,10 @@ static int test_readdir_os2_delete_ret;
 #define MIN(a,b) ((a)<(b)?(a):(b))
 #endif
 
+#ifdef _WIN32
+#define mkdir(d,m) _mkdir(d)
+#endif
+
 static void cleanup(void)
 {
 	/* I'm a lazy bastard */
diff --git a/source3/configure.in b/source3/configure.in
index d0ff14f..663c3a8 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -671,6 +671,7 @@ SAVE_CPPFLAGS="${CPPFLAGS}"
 CPPFLAGS="${CPPFLAGS} ${SAMBA_CONFIGURE_CPPFLAGS}"
 
 AC_LIBREPLACE_BROKEN_CHECKS
+AC_CHECK_FUNCS([syslog],[],[AC_MSG_ERROR([Required function not found])])
 AC_LIBREPLACE_NETWORK_CHECKS
 
 CPPFLAGS="${SAVE_CPPFLAGS}"
diff --git a/source3/m4/aclocal.m4 b/source3/m4/aclocal.m4
index 386829d..ae20502 100644
--- a/source3/m4/aclocal.m4
+++ b/source3/m4/aclocal.m4
@@ -334,7 +334,7 @@ AC_DEFUN([AC_CHECK_FUNC_EXT],
 	    [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1])) $3], 
 	    [$4])dnl
 AS_VAR_POPDEF([ac_var])dnl
-])# AC_CHECK_FUNC
+])# AC_CHECK_FUNC_EXT
 
 # AH_CHECK_FUNC_EXT(FUNCNAME)
 # ---------------------


-- 
Samba Shared Repository


More information about the samba-cvs mailing list