diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/lib/util.c HEAD-ioctl/source/lib/util.c
--- HEAD/source/lib/util.c	Wed Mar 12 22:17:47 2003
+++ HEAD-ioctl/source/lib/util.c	Fri Mar 14 09:20:00 2003
@@ -1401,6 +1401,16 @@ void smb_panic(const char *why)
 	char *cmd = lp_panic_action();
 	int result;
 
+#ifdef DEVELOPER
+{
+	extern pstring global_clobber_region_panic;
+
+	if (global_clobber_region_panic[0]!='\0') {
+		DEBUG(0,("smb_panic: clobber_region() called from [%s]\n",
+			global_clobber_region_panic));
+	} 
+}
+#endif
 	if (cmd && *cmd) {
 		DEBUG(0, ("smb_panic(): calling panic action [%s]\n", cmd));
 		result = system(cmd);
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/lib/util_str.c HEAD-ioctl/source/lib/util_str.c
--- HEAD/source/lib/util_str.c	Wed Mar 12 08:21:08 2003
+++ HEAD-ioctl/source/lib/util_str.c	Fri Mar 14 10:54:56 2003
@@ -442,21 +442,29 @@ BOOL str_is_all(const char *s,char c)
  * This is meant to catch possible string overflows, even if the
  * actual string copied is not big enough to cause an overflow.
  **/
-void clobber_region(char *dest, size_t len)
-{
 #ifdef DEVELOPER
+pstring global_clobber_region_panic;
+
+void clobber_region_fn(const char *fn, int line, char *dest, size_t len)
+{
+	DEBUG(101,("clobber...%s() line(%d)",fn,line));
+	pstr_sprintf(global_clobber_region_panic, "%s() line(%d)",fn,line);	
 	/* F1 is odd and 0xf1f1f1f1 shouldn't be a valid pointer */
 	memset(dest, 0xF1, len);
-#endif
+	pstrcat(global_clobber_region_panic,"...ok");
+	DEBUGADD(101,("...ok\n"));
 }
-
+#endif /* DEVELOPER */
 
 /**
  Safe string copy into a known length string. maxlength does not
  include the terminating zero.
 **/
-
+#ifdef DEVELOPER
+char *safe_strcpy_fn(const char *fn, int line, char *dest,const char *src, size_t maxlength)
+#else
 char *safe_strcpy(char *dest,const char *src, size_t maxlength)
+#endif
 {
 	size_t len;
 
@@ -465,7 +473,9 @@ char *safe_strcpy(char *dest,const char 
 		return NULL;
 	}
 
-	clobber_region(dest, maxlength+1);
+#ifdef DEVELOPER
+	clobber_region_fn(fn,line,dest, maxlength+1);
+#endif
 
 	if (!src) {
 		*dest = 0;
@@ -489,8 +499,11 @@ char *safe_strcpy(char *dest,const char 
  Safe string cat into a string. maxlength does not
  include the terminating zero.
 **/
-
+#ifdef DEVELOPER
+char *safe_strcat_fn(const char *fn, int line, char *dest, const char *src, size_t maxlength)
+#else
 char *safe_strcat(char *dest, const char *src, size_t maxlength)
+#endif
 {
 	size_t src_len, dest_len;
 
@@ -505,8 +518,10 @@ char *safe_strcat(char *dest, const char
 	src_len = strlen(src);
 	dest_len = strlen(dest);
 
-	clobber_region(dest + dest_len, maxlength + 1 - dest_len);
-	
+#ifdef DEVELOPER
+	clobber_region_fn(fn, line, dest + dest_len, maxlength + 1 - dest_len);
+#endif
+
 	if (src_len + dest_len > maxlength) {
 		DEBUG(0,("ERROR: string overflow by %d in safe_strcat [%.50s]\n",
 			 (int)(src_len + dest_len - maxlength), src));
@@ -528,12 +543,17 @@ char *safe_strcat(char *dest, const char
  and replaces with '_'. Deliberately does *NOT* check for multibyte
  characters. Don't change it !
 **/
-
+#ifdef DEVELOPER
+char *alpha_strcpy_fn(const char *fn, int line, char *dest, const char *src, const char *other_safe_chars, size_t maxlength)
+#else
 char *alpha_strcpy(char *dest, const char *src, const char *other_safe_chars, size_t maxlength)
+#endif
 {
 	size_t len, i;
 
-	clobber_region(dest, maxlength);
+#ifdef DEVELOPER
+	clobber_region_fn(fn, line, dest, maxlength);
+#endif
 
 	if (!dest) {
 		DEBUG(0,("ERROR: NULL dest in alpha_strcpy\n"));
@@ -569,13 +589,18 @@ char *alpha_strcpy(char *dest, const cha
  Like strncpy but always null terminates. Make sure there is room!
  The variable n should always be one less than the available size.
 **/
-
+#ifdef DEVELOPER
+char *StrnCpy_fn(const char *fn, int line,char *dest,const char *src,size_t n)
+#else
 char *StrnCpy(char *dest,const char *src,size_t n)
+#endif
 {
 	char *d = dest;
 
-	clobber_region(dest, n+1);
-	
+#ifdef DEVELOPER
+	clobber_region_fn(fn, line, dest, n+1);
+#endif
+
 	if (!dest)
 		return(NULL);
 	
@@ -593,13 +618,18 @@ char *StrnCpy(char *dest,const char *src
  Like strncpy but copies up to the character marker.  always null terminates.
  returns a pointer to the character marker in the source string (src).
 **/
-
+#ifdef DEVELOPER
+char *strncpyn_fn(const char *fn, int line,char *dest, const char *src, size_t n, char c)
+#else
 char *strncpyn(char *dest, const char *src, size_t n, char c)
+#endif
 {
 	char *p;
 	size_t str_len;
 
-	clobber_region(dest, n+1);
+#ifdef DEVELOPER
+	clobber_region_fn(fn, line, dest, n+1);
+#endif
 
 	p = strchr_m(src, c);
 	if (p == NULL) {
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/include/safe_string.h HEAD-ioctl/source/include/safe_string.h
--- HEAD/source/include/safe_string.h	Wed Mar  5 12:46:48 2003
+++ HEAD-ioctl/source/include/safe_string.h	Fri Mar 14 09:03:06 2003
@@ -96,4 +96,12 @@ char * __unsafe_string_function_usage_he
 #define push_pstring_base(dest, src, pstring_base) \
     push_ascii(dest, src, sizeof(pstring)-PTR_DIFF(dest,pstring_base)-1, STR_TERMINATE)
 
+#ifdef DEVELOPER
+#define safe_strcpy(dest,src,maxlength)	safe_strcpy_fn(__FUNCTION__,__LINE__,dest,src,maxlength)
+#define safe_strcat(dest,src,maxlength)	safe_strcat_fn(__FUNCTION__,__LINE__,dest,src,maxlength)
+#define alpha_strcpy(dest,src,other_safe_chars,maxlength) alpha_strcpy_fn(__FUNCTION__,__LINE__,dest,src,other_safe_chars,maxlength)
+#define StrnCpy(dest,src,n)		StrnCpy_fn(__FUNCTION__,__LINE__,dest,src,n)
+#define strncpyn(dest, src, n, c)	strncpyn_fn(__FUNCTION__,__LINE__,dest,src,n,c)
+#endif /* DEVELOPER */
+
 #endif
