svn commit: samba r9097 - in trunk/source/registry: .

jerry at samba.org jerry at samba.org
Fri Aug 5 04:46:33 GMT 2005


Author: jerry
Date: 2005-08-05 04:46:33 +0000 (Fri, 05 Aug 2005)
New Revision: 9097

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9097

Log:
fix perfount crashes
Modified:
   trunk/source/registry/reg_perfcount.c


Changeset:
Modified: trunk/source/registry/reg_perfcount.c
===================================================================
--- trunk/source/registry/reg_perfcount.c	2005-08-05 04:36:31 UTC (rev 9096)
+++ trunk/source/registry/reg_perfcount.c	2005-08-05 04:46:33 UTC (rev 9097)
@@ -13,14 +13,17 @@
 	char key[] = "1";
 	uint32 retval = 0;
 	char buf[PERFCOUNT_MAX_LEN];
+	const char *counter_dir = lp_counters_dir();
+	
 
-	pstrcpy(fname, lp_counters_dir());
-	pstrcat(fname, "/names.tdb");
+	if ( !*counter_dir ) 
+		return 0;
 
+	pstr_sprintf( fname, "%s/names.tdb", counter_dir );
+
 	names = tdb_open_log(fname, 0, TDB_DEFAULT, O_RDONLY, 0444);
 
-	if(names == NULL)
-	{
+	if ( !names ) {
 		DEBUG(1, ("reg_perfcount_get_base_index: unable to open [%s].\n", fname));
 		return 0;
 	}    



More information about the samba-cvs mailing list