[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Fri Oct 3 18:35:02 MDT 2014


The branch, master has been updated
       via  1584095 windbindd: Make cm_connect_lsa_tcp static
       via  5da31a9 smbd: Always use uint8_t for inbuf pointer
       via  6ab998f smbd: Pass only cmd to construct_reply_common instead of complete req
       via  b7af51a smbd: Use MIN macro in fake_sendfile
       via  0e3ea71 s3-winbindd: Make wcache_sid_to_name static
       via  d46081b s3-winbindd: Remove extern declaration for cache_methods from winbindd_dual.c
       via  c12aa0c lib/util: Use charset_compat.h if SAMBA_UTIL_CORE_ONLY
       via  1fd4556 lib/util: Factor out subsystem samba-util-core from samba-util
       via  db15cc5 lib/util: Clean up includes for util.c
       via  8dac190 lib/util: Clean up includes for fault.c
       via  d929408 lib/util: Clean up includes for substitute.c
       via  2426130 lib/util: Replace an SMB_ASSERT()
       via  b69edfe lib/util: Clean up includes for signal.c
       via  fd9f0c2 lib/util: Clean up includes for time.[ch]
       via  1f0e5cb lib/util: Clean up includes for data_blob.[ch]
       via  2d7dfe3 lib/util: Clean up includes for xfile.[ch]
       via  3d6675f lib/util: Clean up includes for blocking.c
      from  5496270 profiling: Make WITH_PROFILE span more in smbprofile.h

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


- Log -----------------------------------------------------------------
commit 15840955cb5bcb7ec74c396852299776e94ccd0f
Author: Christof Schmitt <cs at samba.org>
Date:   Fri Oct 3 10:36:02 2014 -0700

    windbindd: Make cm_connect_lsa_tcp static
    
    It is only used in winbindd_cm.c
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Sat Oct  4 02:34:49 CEST 2014 on sn-devel-104

commit 5da31a9260b592e84a4edbb9fd1a29e3d099e5b6
Author: Christof Schmitt <cs at samba.org>
Date:   Tue Sep 2 12:24:29 2014 -0700

    smbd: Always use uint8_t for inbuf pointer
    
    This avoids some casts from char pointers.
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 6ab998f3fe592350cae47a077b73be30b790af59
Author: Christof Schmitt <cs at samba.org>
Date:   Tue Sep 2 12:18:30 2014 -0700

    smbd: Pass only cmd to construct_reply_common instead of complete req
    
    construct_reply_common only needs the commands code and the inbuf field,
    not the complete request.
    
    Signed-off-by: Christof Schmitt <cs at samba.org>

commit b7af51a1424483371c61f34dbbf0c8bddcaae48c
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Aug 11 13:19:46 2014 -0700

    smbd: Use MIN macro in fake_sendfile
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 0e3ea71c21d682ae4378230ccd4d5c859da75891
Author: Christof Schmitt <cs at samba.org>
Date:   Fri Aug 29 18:05:43 2014 -0700

    s3-winbindd: Make wcache_sid_to_name static
    
    It is only used in winbindd_cache.c
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit d46081bf43ff1fa43b7e38329c37de9910cab8ce
Author: Christof Schmitt <cs at samba.org>
Date:   Fri Aug 29 18:04:27 2014 -0700

    s3-winbindd: Remove extern declaration for cache_methods from winbindd_dual.c
    
    cache_methods is not used in winbindd_dual.c
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit c12aa0c444555f2c8051492083abba69fb94586f
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Sep 22 20:26:24 2014 +1000

    lib/util: Use charset_compat.h if SAMBA_UTIL_CORE_ONLY
    
    When doing a CTDB standalone build we don't want to use dynconfig,
    since this introduces a lot of unwanted complexity.  To avoid this,
    either:
    
    * charset needs to be nobbled to avoid loading the case tables, since
      this depends on dynconfig; or
    
    * charset needs to be avoid completely, so some functions need to be
      replaced with their ASCII counterparts.
    
    The 2nd options seems more honest and less error-prone.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 1fd4556917df5d7e2aff4997ff7e5b57f2569b40
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Aug 15 16:00:32 2014 +1000

    lib/util: Factor out subsystem samba-util-core from samba-util
    
    samba-util depends on Samba-specific code.  Exclude this code from
    samba-util-core.  When told to, via SAMBA_UTIL_CORE_ONLY, only build
    samba-util-core and dependencies.  When SAMBA_UTIL_CORE_ONLY is not
    defined then the behaviour should be unchanged.
    
    Standalone builds of CTDB will be done against samba-util-core to
    avoid pulling in Samba-specific code.
    
    An alternative would be to remove the Samba-dependent code from
    samba-util.  However, some of it is used by OpenChange.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit db15cc5388efdb0803bd2f785f8b6eee7f46ecbf
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Sep 22 18:28:53 2014 +1000

    lib/util: Clean up includes for util.c
    
    Allows standalone compiles without external includes.h.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 8dac190ee1bc0e7f6d17eeca097f027fcaf584ed
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Sep 22 19:43:27 2014 +1000

    lib/util: Clean up includes for fault.c
    
    Add fault.h.  Allows standalone compiles without external includes.h.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit d92940819f4162985a70f6b2c79032f75f9fce49
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Sep 22 20:38:52 2014 +1000

    lib/util: Clean up includes for substitute.c
    
    Add substitute.h.  Allows standalone compiles without external
    includes.h.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 2426130c90b216d131330e896daf7302cc198b4a
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Sep 24 04:41:25 2014 +1000

    lib/util: Replace an SMB_ASSERT()
    
    Avoid a cyclic dependency.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit b69edfed7db299e53e95bcb26cc2899ddd3adb28
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Sep 22 19:57:52 2014 +1000

    lib/util: Clean up includes for signal.c
    
    Add signal.h.  Allows standalone compiles without external includes.h.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit fd9f0c27e71cdda833e9dd24f0eb87ad524e73cf
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Sep 22 19:38:18 2014 +1000

    lib/util: Clean up includes for time.[ch]
    
    Allows standalone compile without external includes.h.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 1f0e5cb38c6d444d33b7736d43a32439cdf04d81
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Sep 22 19:31:23 2014 +1000

    lib/util: Clean up includes for data_blob.[ch]
    
    Allows standalone compile without external includes.h.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 2d7dfe3d68c39f11afdece3281f9fbca0b48fb3f
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Sep 22 19:21:42 2014 +1000

    lib/util: Clean up includes for xfile.[ch]
    
    The include files added to xfile.h are already included
    unconditionally elsewhere (replace.h, samba_util.h, ...) so Samba
    can't be built without them.
    
    To minimise dependencies, only include specific util headers instead
    of samba_util.h.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 3d6675fd1ee32ba0795f7f09f42a1b005ba5e621
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Sep 22 18:14:53 2014 +1000

    lib/util: Clean up includes for blocking.c
    
    Add blocking.h.  Allows standalone compile without external
    includes.h.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 lib/util/blocking.c                                |    3 +-
 libcli/smb/smb_util.h => lib/util/blocking.h       |   21 ++-
 lib/util/charset_compat.h                          |    9 +
 lib/util/data_blob.c                               |    4 +-
 lib/util/data_blob.h                               |    1 +
 lib/util/fault.c                                   |    8 +-
 lib/util/{util_pw.h => fault.h}                    |   46 ++++--
 lib/util/samba_util.h                              |   95 +----------
 lib/util/signal.c                                  |    4 +-
 .../headers/test_headers.c => lib/util/signal.h    |   46 +++---
 lib/util/substitute.c                              |   15 ++-
 lib/util/substitute.h                              |   56 +++++++
 lib/util/time.c                                    |    6 +-
 lib/util/time.h                                    |    4 +
 lib/util/util.c                                    |    7 +-
 lib/util/wscript_build                             |  173 +++++++++++---------
 lib/util/xfile.c                                   |    3 +-
 lib/util/xfile.h                                   |    6 +
 source3/smbd/process.c                             |   18 +-
 source3/smbd/reply.c                               |    6 +-
 source3/winbindd/winbindd_cache.c                  |   12 +-
 source3/winbindd/winbindd_cm.c                     |    6 +-
 source3/winbindd/winbindd_dual.c                   |    1 -
 source3/winbindd/winbindd_proto.h                  |    9 -
 24 files changed, 311 insertions(+), 248 deletions(-)
 copy libcli/smb/smb_util.h => lib/util/blocking.h (65%)
 create mode 100644 lib/util/charset_compat.h
 copy lib/util/{util_pw.h => fault.h} (50%)
 copy testsuite/headers/test_headers.c => lib/util/signal.h (50%)
 create mode 100644 lib/util/substitute.h


Changeset truncated at 500 lines:

diff --git a/lib/util/blocking.c b/lib/util/blocking.c
index 157804a..358eda0 100644
--- a/lib/util/blocking.c
+++ b/lib/util/blocking.c
@@ -21,10 +21,11 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "includes.h"
+#include "replace.h"
 #include "system/network.h"
 #include "system/filesys.h"
 #include "system/locale.h"
+#include "blocking.h"
 #undef malloc
 #undef strcasecmp
 #undef strncasecmp
diff --git a/libcli/smb/smb_util.h b/lib/util/blocking.h
similarity index 65%
copy from libcli/smb/smb_util.h
copy to lib/util/blocking.h
index 322ecb6..017e424 100644
--- a/libcli/smb/smb_util.h
+++ b/lib/util/blocking.h
@@ -1,9 +1,11 @@
 /*
    Unix SMB/CIFS implementation.
-   client file operations
-   Copyright (C) Andrew Tridgell 1994-1998
+   Samba utility functions
+   Copyright (C) Andrew Tridgell 1992-1998
    Copyright (C) Jeremy Allison 2001-2002
-   Copyright (C) James Myers 2003
+   Copyright (C) Simo Sorce 2001
+   Copyright (C) Jim McDonough (jmcd at us.ibm.com)  2003.
+   Copyright (C) James J Myers 2003
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -19,9 +21,12 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-char *attrib_string(TALLOC_CTX *mem_ctx, uint32_t attrib);
-uint32_t unix_perms_to_wire(mode_t perms);
-mode_t wire_perms_to_unix(uint32_t perms);
-mode_t unix_filetype_from_wire(uint32_t wire_type);
+#ifndef _SAMBA_BLOCKING_H_
+#define _SAMBA_BLOCKING_H_
 
-bool smb_buffer_oob(uint32_t bufsize, uint32_t offset, uint32_t length);
+#include <stdbool.h>
+
+int set_blocking(int fd, bool set);
+bool smb_set_close_on_exec(int fd);
+
+#endif /* _SAMBA_BLOCKING_H_ */
diff --git a/lib/util/charset_compat.h b/lib/util/charset_compat.h
new file mode 100644
index 0000000..cb3b625
--- /dev/null
+++ b/lib/util/charset_compat.h
@@ -0,0 +1,9 @@
+#ifndef _SAMBA_CHARSET_COMPAT_H_
+#define _SAMBA_CHARSET_COMPAT_H_
+
+#include <string.h>
+
+#define strchr_m(h, n) strchr(h, n)
+#define strstr_m(h, n) strstr(h, n)
+
+#endif /* _SAMBA_CHARSET_COMPAT_H_ */
diff --git a/lib/util/data_blob.c b/lib/util/data_blob.c
index 10864a0..1b0e6ab 100644
--- a/lib/util/data_blob.c
+++ b/lib/util/data_blob.c
@@ -18,7 +18,9 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "includes.h"
+#include "replace.h"
+#include "attr.h"
+#include "data_blob.h"
 
 const DATA_BLOB data_blob_null = { NULL, 0 };
 
diff --git a/lib/util/data_blob.h b/lib/util/data_blob.h
index 09a9292..a5caa92 100644
--- a/lib/util/data_blob.h
+++ b/lib/util/data_blob.h
@@ -31,6 +31,7 @@
 #endif
 
 #include <talloc.h>
+#include <stdbool.h>
 #include <stdint.h>
 
 /* used to hold an arbitrary blob of data */
diff --git a/lib/util/fault.c b/lib/util/fault.c
index 78d9177..54d8471 100644
--- a/lib/util/fault.c
+++ b/lib/util/fault.c
@@ -18,8 +18,9 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "includes.h"
+#include "replace.h"
 #include "system/filesys.h"
+#include "system/wait.h"
 #include "version.h"
 
 #ifdef HAVE_SYS_SYSCTL_H
@@ -31,6 +32,11 @@
 #include <sys/prctl.h>
 #endif
 
+#include "debug.h"
+#include "lib/util/signal.h" /* Avoid /usr/include/signal.h */
+#include "substitute.h"
+#include "fault.h"
+
 static struct {
 	bool disabled;
 	smb_panic_handler_t panic_handler;
diff --git a/lib/util/util_pw.h b/lib/util/fault.h
similarity index 50%
copy from lib/util/util_pw.h
copy to lib/util/fault.h
index fae4da9..98a24a3 100644
--- a/lib/util/util_pw.h
+++ b/lib/util/fault.h
@@ -1,11 +1,8 @@
 /*
    Unix SMB/CIFS implementation.
-
-   Safe versions of getpw* calls
-
+   Critical Fault handling
    Copyright (C) Andrew Tridgell 1992-1998
-   Copyright (C) Jeremy Allison 1997-2001.
-   Copyright (C) Andrew Bartlett 2002
+   Copyright (C) Tim Prouty 2009
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -21,12 +18,37 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef __LIB_UTIL_UTIL_PW_H__
-#define __LIB_UTIL_UTIL_PW_H__
+#ifndef _SAMBA_FAULT_H_
+#define _SAMBA_FAULT_H_
+
+#include <sys/types.h>
+
+#include "attr.h"
+#include "debug.h"
+
+/**
+ * assert macros
+ */
+#define SMB_ASSERT(b) \
+do { \
+	if (!(b)) { \
+		DEBUG(0,("PANIC: assert failed at %s(%d): %s\n", \
+			 __FILE__, __LINE__, #b)); \
+		smb_panic("assert failed: " #b); \
+	} \
+} while(0)
+
+extern const char *panic_action;
+
+/**
+ Something really nasty happened - panic !
+**/
+typedef void (*smb_panic_handler_t)(const char *why);
+
+void fault_configure(smb_panic_handler_t panic_handler);
+void fault_setup(void);
+void fault_setup_disable(void);
+_NORETURN_ void smb_panic(const char *reason);
 
-struct passwd *tcopy_passwd(TALLOC_CTX *mem_ctx,
-			    const struct passwd *from);
-struct passwd *getpwnam_alloc(TALLOC_CTX *mem_ctx, const char *name);
-struct passwd *getpwuid_alloc(TALLOC_CTX *mem_ctx, uid_t uid);
 
-#endif /* __LIB_UTIL_UTIL_PW_H__ */
+#endif /* _SAMBA_FAULT_H_ */
diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h
index e9de6fa..41b3fc8 100644
--- a/lib/util/samba_util.h
+++ b/lib/util/samba_util.h
@@ -21,7 +21,12 @@
 #ifndef _SAMBA_UTIL_H_
 #define _SAMBA_UTIL_H_
 
+#ifndef SAMBA_UTIL_CORE_ONLY
 #include "lib/util/charset/charset.h"
+#else
+#include "charset_compat.h"
+#endif
+
 #include "lib/util/attr.h"
 
 /* for TALLOC_CTX */
@@ -45,18 +50,6 @@ extern const char *panic_action;
 #include "lib/util/byteorder.h"
 #include "lib/util/talloc_stack.h"
 
-/**
- * assert macros 
- */
-#define SMB_ASSERT(b) \
-do { \
-	if (!(b)) { \
-		DEBUG(0,("PANIC: assert failed at %s(%d): %s\n", \
-			 __FILE__, __LINE__, #b)); \
-		smb_panic("assert failed: " #b); \
-	} \
-} while(0)
-
 #ifndef ABS
 #define ABS(a) ((a)>0?(a):(-(a)))
 #endif
@@ -66,22 +59,14 @@ do { \
 #include "../libcli/util/ntstatus.h"
 #include "lib/util/string_wrappers.h"
 
+#include "fault.h"
+
 /**
  * Write backtrace to debug log
  */
 _PUBLIC_ void call_backtrace(void);
 
-/**
- Something really nasty happened - panic !
-**/
-typedef void (*smb_panic_handler_t)(const char *why);
-
-_PUBLIC_ void fault_configure(smb_panic_handler_t panic_handler);
-_PUBLIC_ void fault_setup(void);
-_PUBLIC_ void fault_setup_disable(void);
 _PUBLIC_ void dump_core_setup(const char *progname, const char *logfile);
-_PUBLIC_ _NORETURN_ void smb_panic(const char *reason);
-
 
 /**
   register a fault handler. 
@@ -89,31 +74,7 @@ _PUBLIC_ _NORETURN_ void smb_panic(const char *reason);
 */
 _PUBLIC_ bool register_fault_handler(const char *name, void (*fault_handler)(int sig));
 
-/* The following definitions come from lib/util/signal.c  */
-
-
-/**
- Block sigs.
-**/
-void BlockSignals(bool block, int signum);
-
-/**
- Catch a signal. This should implement the following semantics:
-
- 1) The handler remains installed after being called.
- 2) The signal should be blocked during handler execution.
-**/
-void (*CatchSignal(int signum,void (*handler)(int )))(int);
-
-/**
- Ignore SIGCLD via whatever means is necessary for this OS.
-**/
-void (*CatchChild(void))(int);
-
-/**
- Catch SIGCLD but leave the child around so it's status can be reaped.
-**/
-void (*CatchChildLeaveStatus(void))(int);
+#include "lib/util/signal.h" /* Avoid /usr/include/signal.h */
 
 struct sockaddr;
 
@@ -253,32 +214,7 @@ _PUBLIC_ void hex_encode(const unsigned char *buff_in, size_t len, char **out_he
  */
 _PUBLIC_ char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, size_t len);
 
-/**
- Substitute a string for a pattern in another string. Make sure there is 
- enough room!
-
- This routine looks for pattern in s and replaces it with 
- insert. It may do multiple replacements.
-
- Any of " ; ' $ or ` in the insert string are replaced with _
- if len==0 then the string cannot be extended. This is different from the old
- use of len==0 which was for no length checks to be done.
-**/
-_PUBLIC_ void string_sub(char *s,const char *pattern, const char *insert, size_t len);
-
-_PUBLIC_ void string_sub_once(char *s, const char *pattern,
-			      const char *insert, size_t len);
-
-_PUBLIC_ char *string_sub_talloc(TALLOC_CTX *mem_ctx, const char *s, 
-				const char *pattern, const char *insert);
-
-/**
- Similar to string_sub() but allows for any character to be substituted. 
- Use with caution!
- if len==0 then the string cannot be extended. This is different from the old
- use of len==0 which was for no length checks to be done.
-**/
-_PUBLIC_ void all_string_sub(char *s,const char *pattern,const char *insert, size_t len);
+#include "substitute.h"
 
 /**
  Unescape a URL encoded string, in place.
@@ -649,18 +585,7 @@ _PUBLIC_ bool directory_create_or_exist_strict(const char *dname,
 					       uid_t uid,
 					       mode_t dir_perms);
 
-/**
- Set a fd into blocking/nonblocking mode. Uses POSIX O_NONBLOCK if available,
- else
-  if SYSV use O_NDELAY
-  if BSD use FNDELAY
-**/
-_PUBLIC_ int set_blocking(int fd, bool set);
-
-/**
-   set close on exec on a file descriptor if available
- **/
-_PUBLIC_ bool smb_set_close_on_exec(int fd);
+#include "blocking.h"
 
 /**
  Sleep for a specified number of milliseconds.
diff --git a/lib/util/signal.c b/lib/util/signal.c
index 33a9900..3fc63b2 100644
--- a/lib/util/signal.c
+++ b/lib/util/signal.c
@@ -18,8 +18,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "includes.h"
+#include "replace.h"
 #include "system/wait.h"
+#include "debug.h"
+#include "lib/util/signal.h" /* Avoid /usr/include/signal.h */
 
 /**
  * @file
diff --git a/testsuite/headers/test_headers.c b/lib/util/signal.h
similarity index 50%
copy from testsuite/headers/test_headers.c
copy to lib/util/signal.h
index a36575f..0663af6 100644
--- a/testsuite/headers/test_headers.c
+++ b/lib/util/signal.h
@@ -1,7 +1,8 @@
 /*
    Unix SMB/CIFS implementation.
+   signal handling functions
 
-   Copyright (C) Andrew Tridgell		2011
+   Copyright (C) Andrew Tridgell 1998
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -17,27 +18,32 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-/*
-  this tests that all of our public headers will build
- */
-
-#define _GNU_SOURCE 1
+#ifndef _SAMBA_UTIL_SIGNAL_H_
+#define _SAMBA_UTIL_SIGNAL_H_
 
-#include <Python.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdint.h>
 #include <stdbool.h>
 
-/* pre-include some of the public headers to avoid ordering issues */
-#include "core/ntstatus.h"
+/**
+ Block sigs.
+**/
+void BlockSignals(bool block, int signum);
+
+/**
+ Catch a signal. This should implement the following semantics:
+
+ 1) The handler remains installed after being called.
+ 2) The signal should be blocked during handler execution.
+**/
+void (*CatchSignal(int signum,void (*handler)(int )))(int);
+
+/**
+ Ignore SIGCLD via whatever means is necessary for this OS.
+**/
+void (*CatchChild(void))(int);
 
-/* include all our public headers */
-#include "test_headers.h"
+/**
+ Catch SIGCLD but leave the child around so it's status can be reaped.
+**/
+void (*CatchChildLeaveStatus(void))(int);
 
-int main(void)
-{
-	printf("All OK\n");
-	return 0;
-}
+#endif /* _SAMBA_UTIL_SIGNAL_H_ */
diff --git a/lib/util/substitute.c b/lib/util/substitute.c
index 500d127..49adeaf 100644
--- a/lib/util/substitute.c
+++ b/lib/util/substitute.c
@@ -21,7 +21,14 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "includes.h"
+#include "replace.h"
+#include "debug.h"
+#ifndef SAMBA_UTIL_CORE_ONLY
+#include "charset/charset.h"
+#else
+#include "charset_compat.h"
+#endif
+#include "substitute.h"
 
 /**
  * @file
@@ -146,7 +153,11 @@ _PUBLIC_ char *string_sub_talloc(TALLOC_CTX *mem_ctx, const char *s,
 	if (ret == NULL)
 		return NULL;
 
-	SMB_ASSERT(ret[len] == '\0');
+	if (ret[len] != '\0') {
+		DEBUG(0,("Internal error at %s(%d): string not terminated\n",
+			 __FILE__, __LINE__));
+		abort();
+	}
 
 	talloc_set_name_const(ret, ret);
 
diff --git a/lib/util/substitute.h b/lib/util/substitute.h
new file mode 100644
index 0000000..5ba469c
--- /dev/null
+++ b/lib/util/substitute.h
@@ -0,0 +1,56 @@
+/*
+   Unix SMB/CIFS implementation.
+   Samba utility functions
+
+   Copyright (C) Andrew Tridgell 1992-2001
+   Copyright (C) Simo Sorce      2001-2002
+   Copyright (C) Martin Pool     2003
+   Copyright (C) James Peach	 2005
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef _SAMBA_SUBSTITUTE_H_
+#define _SAMBA_SUBSTITUTE_H_
+
+#include <talloc.h>
+
+/**
+ Substitute a string for a pattern in another string. Make sure there is
+ enough room!
+
+ This routine looks for pattern in s and replaces it with
+ insert. It may do multiple replacements.
+
+ Any of " ; ' $ or ` in the insert string are replaced with _


-- 
Samba Shared Repository


More information about the samba-cvs mailing list