[PATCH] logging during tdb_open does not work when using tdb_open_log

Alexander Bokovoy a.bokovoy at sam-solutions.net
Sat Jan 5 08:36:02 GMT 2002


Greetings!

In CVS HEAD tdb_open_log assigns logging function only after TDB file was
successfully opened. This means that opening errors can't be logged into
Samba's DEBUG facility and therefore can't be caught by programmer.

Is it by design or this is a logical error?

In latter case attached patch fixes it.

-- 
/ Alexander Bokovoy
$ cat /proc/identity >~/.signature
  `Senior software developer and analyst for SaM-Solutions Ltd.`
---
Nov 21 20:58:58 alconost kernel: VFS: Busy inodes after unmount. 
		    Self-destruct in 5 seconds.  Have a nice day...
-------------- next part --------------
Index: source/tdb/tdbutil.c
===================================================================
RCS file: /cvsroot/samba/source/tdb/tdbutil.c,v
retrieving revision 1.29
diff -u -u -r1.29 tdbutil.c
--- source/tdb/tdbutil.c	3 Jan 2002 22:48:48 -0000	1.29
+++ source/tdb/tdbutil.c	5 Jan 2002 16:28:59 -0000
@@ -390,12 +390,10 @@
 	if (!lp_use_mmap())
 		tdb_flags |= TDB_NOMMAP;
 
-	tdb = tdb_open(name, hash_size, tdb_flags, 
-				    open_flags, mode);
+	tdb = tdb_open_ex(name, hash_size, tdb_flags, 
+				    open_flags, mode, tdb_log);
 	if (!tdb)
 		return NULL;
-
-	tdb_logging_function(tdb, tdb_log);
 
 	return tdb;
 }


More information about the samba-technical mailing list