$NetBSD: patch-br,v 1.2 2006/01/02 22:33:36 jlam Exp $

--- lib/util.c.orig	2005-12-20 10:28:38.000000000 -0500
+++ lib/util.c
@@ -2375,6 +2375,26 @@ char *lock_path(const char *name)
 }
 
 /*****************************************************************
+ A useful function for returning a path in the Samba state directory.
+*****************************************************************/  
+
+char *state_path(const char *name)
+{
+	static pstring fname;
+
+	pstrcpy(fname,lp_statedir());
+	trim_char(fname,'\0','/');
+	
+	if (!directory_exist(fname,NULL))
+		mkdir(fname,0755);
+	
+	pstrcat(fname,"/");
+	pstrcat(fname,name);
+
+	return fname;
+}
+
+/*****************************************************************
  A useful function for returning a path in the Samba pid directory.
 *****************************************************************/
 
